pub fn decode_json(json: Vec<ValueData>) -> Result<String, serde_json::error::Error> {
    let decode_value = json.iter()
                           .map(|row| {
                               match row.clone() {
                                   ValueData {
                                        Key: key,
                                        Flags: flags,
                                        Value: value,
                                        ..
                } => {
                                       ValueDataOut {
                                           Key: key,
                                           Flags: flags,
                                           Value: String::from_utf8(value.from_base64().unwrap())
                                                      .unwrap(),
                                       }
                                   }
                               }
                           })
                           .collect::<Vec<_>>();
    serde_json::to_string_pretty(&decode_value)
}
// take in the json as Vec<ValueData> grab the three fields we want & decode value from base 64
// then reencode to a new struct of Vec<ValueDataOut> so we can remove those three fields
take in the json as Vec grab the three fields we want & decode value from base 64
then reencode to a new struct of Vec so we can remove those three fields
take in the json as Vec grab the three fields we want & decode value from base 64 then reencode to a new struct of Vec so we can remove those three fields
pub fn decode_json(json: Vec<ValueData>) -> Result<String, serde_json::error::Error> {
    let decode_value = json.iter()
                           .map(|row| {
                               match row.clone() {
                                   ValueData {
                                        Key: key,
                                        Flags: flags,
                                        Value: value,
                                        ..
                } => {
                                       ValueDataOut {
                                           Key: key,
                                           Flags: flags,
                                           Value: String::from_utf8(value.from_base64().unwrap())
                                                      .unwrap(),
                                       }
                                   }
                               }
                           })
                           .collect::<Vec<_>>();
    serde_json::to_string_pretty(&decode_value)
}
pub fn decode_json ( json : Vec < ValueData > ) -> Result < String , serde_json :: error :: Error > { let decode_value = json . iter ( ) . map ( | row | { match row . clone ( ) { ValueData { Key : key , Flags : flags , Value : value , .. } => { ValueDataOut { Key : key , Flags : flags , Value : String :: from_utf8 ( value . from_base64 ( ) . unwrap ( ) ) . unwrap ( ) , } } } } ) . collect :: < Vec < _ > > ( ) ; serde_json :: to_string_pretty ( & decode_value ) }
take in the json as Vec<ValueData> grab the three fields we want & decode value from base 64
then reencode to a new struct of Vec<ValueDataOut> so we can remove those three fields
take in the json as Vec<ValueData > grab the three fields we want & decode value from base 64 then reencode to a new struct of Vec<ValueDataOut > so we can remove those three fields
json
Vec<ValueData>
json
Vec<ValueData>