cargo serde_yaml 0.5.0

latest releases: 0.9.34+deprecated, 0.9.34-deprecated, 0.9.33...
7 years ago

Breaking changes in 0.5.0

  • Real numbers written in YAML are now deserialized through visit_f64 rather than visit_str; this may affect custom Deserialize implementations that expect to process real numbers as strings (#24, thanks @jwilm)
  • serde_yaml::to_writer no longer flushes the writer after writing; the caller is responsible for flushing if necessary (#29, thanks @emk)
  • serde_yaml::Value is no longer the same type as yaml_rust::Yaml
  • Order of map keys is preserved where before they were sorted alphanumerically; this means that deserializing from YAML to serde_yaml::Value and writing back to YAML will preserve the order of keys in the input, and also serializing a struct to YAML will produce keys in the same order as the fields in the struct

Enhancements

The new serde_yaml::Value implements the Serde Serialize and Deserialize traits, similar to serde_json::Value. This allows structs to be deserialized containing values of any type (#23, thanks @andrewrynhard).

#[derive(Serialize, Deserialize)]
pub struct GenericInstructions {
    #[serde(rename = "type")]
    pub typ: String,
    pub config: Value,
}

Don't miss a new serde_yaml release

NewReleases is sending notifications on new releases.