pub fn json_remove_file(json: &mut serde_json::Value) -> Result<(), Error> {
    match json {
        serde_json::Value::Object(value) => {
            let _ = value.remove("$file");
            Ok(())
            /*
            if let serde_json::Value::String(file) =
                value.remove("$file").ok_or(Error::FileMissing)?
            {
                Ok(PathBuf::from(file))
            } else {
                Err(Error::FileMustBeString)
            }
             */
        }
        _ => Err(Error::RequiresJsonObject),
    }
}
/// Remove the $file property from JSON
Remove the $file property from JSON
Remove the $file property from JSON
pub fn json_remove_file(json: &mut serde_json::Value) -> Result<(), Error> {
    match json {
        serde_json::Value::Object(value) => {
            let _ = value.remove("$file");
            Ok(())
            /*
            if let serde_json::Value::String(file) =
                value.remove("$file").ok_or(Error::FileMissing)?
            {
                Ok(PathBuf::from(file))
            } else {
                Err(Error::FileMustBeString)
            }
             */
        }
        _ => Err(Error::RequiresJsonObject),
    }
}
pub fn json_remove_file ( json : & mut serde_json :: Value ) -> Result < ( ) , Error > { match json { serde_json :: Value :: Object ( value ) => { let _ = value . remove ( " " ) ; Ok ( ( ) ) /*
            if let serde_json::Value::String(file) =
                value.remove("$file").ok_or(Error::FileMissing)?
            {
                Ok(PathBuf::from(file))
            } else {
                Err(Error::FileMustBeString)
            }
             */ } _ => Err ( Error :: RequiresJsonObject ) , } }
Remove the $file property from JSON
Remove the $file property from JSON
json
&mut serde_json::Value
json
&mut serde_json::Value