/// Transforms the JSON Value type into a String.
Transforms the JSON Value type into a String.
Transforms the JSON Value type into a String .
pub fn value_to_string(value: &Value) -> String {
    fn internal_value_to_string(string: &mut String, value: &Value) {
        match value {
            Value::Null => (),
            Value::Bool(boolean) => { let _ = write!(string, "{}", &boolean); },
            Value::Number(number) => { let _ = write!(string, "{}", &number); },
            Value::String(text) => string.push_str(&text),
            Value::Array(array) => {
                for value in array {
                    internal_value_to_string(string, value);
                    let _ = string.write_str(". ");
                }
            },
            Value::Object(object) => {
                for (key, value) in object {
                    string.push_str(key);
                    let _ = string.write_str(". ");
                    internal_value_to_string(string, value);
                    let _ = string.write_str(". ");
                }
            },
        }
    }
    let mut string = String::new();
    internal_value_to_string(&mut string, value);
    string
}
pub fn value_to_string ( value : & Value ) -> String { fn internal_value_to_string ( string : & mut String , value : & Value ) { match value { Value :: Null => ( ) , Value :: Bool ( boolean ) => { let _ = write ! ( string " " boolean ) ; } , Value :: Number ( number ) => { let _ = write ! ( string " " number ) ; } , Value :: String ( text ) => string . push_str ( & text ) , Value :: Array ( array ) => { for value in array { internal_value_to_string ( string , value ) ; let _ = string . write_str ( " " ) ; } } , Value :: Object ( object ) => { for ( key , value ) in object { string . push_str ( key ) ; let _ = string . write_str ( " " ) ; internal_value_to_string ( string , value ) ; let _ = string . write_str ( " " ) ; } } , } } let mut string = String :: new ( ) ; internal_value_to_string ( & mut string , value ) ; string }
Transforms the JSON Value type into a String.
Transforms the JSON Value type into a String .
value
&Value