pub fn flatten_json(buf: &mut Vec<u8>) -> Result<HashMap<String, Vec<String>>, failure::Error> {
    let mut result: HashMap<String, Vec<String>> = HashMap::new();
    let json: simd_json::BorrowedValue = simd_json::to_borrowed_value(buf)?;
    match json {
        Value::Object(mut obj) => {
            for (key, value) in obj.drain() {
                deep_flaten_json(key.into_owned(), value, &mut result);
            }
        }
        _ => panic!("Invalid json object traversal."),
    }
    Ok(result)
}
/// flatten_json flatten the given json into key value pair.
flatten_json flatten the given json into key value pair.
flatten_json flatten the given json into key value pair .
pub fn flatten_json(buf: &mut Vec<u8>) -> Result<HashMap<String, Vec<String>>, failure::Error> {
    let mut result: HashMap<String, Vec<String>> = HashMap::new();
    let json: simd_json::BorrowedValue = simd_json::to_borrowed_value(buf)?;
    match json {
        Value::Object(mut obj) => {
            for (key, value) in obj.drain() {
                deep_flaten_json(key.into_owned(), value, &mut result);
            }
        }
        _ => panic!("Invalid json object traversal."),
    }
    Ok(result)
}
pub fn flatten_json ( buf : & mut Vec < u8 > ) -> Result < HashMap < String , Vec < String > > , failure :: Error > { let mut result : HashMap < String , Vec < String > > = HashMap :: new ( ) ; let json : simd_json :: BorrowedValue = simd_json :: to_borrowed_value ( buf ) ? ; match json { Value :: Object ( mut obj ) => { for ( key , value ) in obj . drain ( ) { deep_flaten_json ( key . into_owned ( ) , value , & mut result ) ; } } _ => panic ! ( " " ) , } Ok ( result ) }
flatten_json flatten the given json into key value pair.
flatten_json flatten the given json into key value pair .
buf
&mut Vec<u8>