Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update rust crate serde_yaml to 0.9 #35

Merged
merged 1 commit into from Aug 27, 2022

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 28, 2022

Mend Renovate

This PR contains the following updates:

Package Type Update Change
serde_yaml dependencies minor 0.8 -> 0.9

Release Notes

dtolnay/serde-yaml

v0.9.10

Compare Source

  • Make Display for Number produce the same representation as serializing (#​316)

v0.9.9

Compare Source

v0.9.8

Compare Source

  • Fix serialization of TaggedValue when used with to_value (#​313)

v0.9.7

Compare Source

  • Allow an empty plain scalar to deserialize as an empty map or seq (#​304)

v0.9.6

Compare Source

  • Fix tag not getting serialized in certain map values (#​302)

v0.9.5

Compare Source

v0.9.4

Compare Source

  • Add serde_yaml::with::singleton_map for serialization of enums as a 1-entry map (#​300)
  • Reject duplicate keys when deserializing Mapping or Value (#​301)

v0.9.3

Compare Source

  • Add categories to crates.io metadata
  • Add keywords to crates.io metadata

v0.9.2

Compare Source

  • Improve Debug representation of serde_yaml::Error

v0.9.1

Compare Source

  • Fix panic on some documents containing syntax error (#​293)
  • Improve error messages that used to contain duplicative line/column information (#​294)

v0.9.0

Compare Source

API documentation: https://docs.rs/serde_yaml/0.9

Highlights
  • The serde_yaml::Value enum gains a Tagged variant which represents the deserialization of YAML's !Tag syntax. Tagged scalars, sequences, and mappings are all supported.

  • An empty YAML input (or document containing only comments) will deserialize successfully to an empty map, empty sequence, or Serde struct as long as the struct has only optional fields. Previously this would error.

  • A new .apply_merge() method on Value implements YAML's << merge key convention.

  • The Debug representation of serde_yaml::Value has gotten vastly better (https://github.com/dtolnay/serde-yaml/pull/287).

  • Deserialization of borrowed strings now works.

    #[derive(Deserialize, Debug)]
    struct Struct<'a> {
        borrowed: &'a str,
    }
    
    let yaml = "borrowed: 'kölcsönzött'\n";
    let value: Struct = serde_yaml::from_str(yaml)?;
    println!("{:#?}", value);
  • Value's and Mapping's methods get and get_mut have been generalized to support a &str argument, as opposed to requiring you to allocate and construct a Value::String for indexing into another existing Value.

  • Mapping exposes more APIs that have become conventional on map data structures, such as .keys(), .values(), .into_keys(), .into_values(), .values_mut(), and .retain(|k, v| …).

Breaking changes
  • Serialization no longer produces leading ---\n on the serialized output. You can prepend this yourself if your use case demands it.

  • Serialization of enum variants is now based on YAML's !Tag syntax, rather than JSON-style singleton maps.

    #[derive(Serialize, Deserialize)]
    enum Enum {
        Newtype(usize),
        Tuple(usize, usize, usize),
        Struct { x: f64, y: f64 },
    }
    - !Newtype 1
    - !Tuple [0, 0, 0]
    - !Struct {x: 1.0, y: 2.0}
  • A bunch of non-base-10 edge cases in number parsing have been resolved. For example 0x+1 and ++0x1 are now parsed as strings, whereas they used to be incorrectly treated as numbers.

  • Deserializers obtained through iteration can no longer be iterated further:

    let deserializer = serde_yaml::Deserializer::from_str(multiple_documents);
    for de in deserializer {
        // correct:
        let myvalue = T::deserialize(de)?;
    
        // incorrect: used to produce some questionable result, now produces 0 sub-documents
        for questionable in de {
            let wat = T::deserialize(questionable)?;
        }
    }
  • The abandoned yaml-rust crate is no longer used as the YAML backend. The new libyaml-based backend surely has different edge cases and quirks than yaml-rust.

  • Some excessive PartialEq impls have been eliminated.

  • The serde_yaml::to_vec function has been removed. Use serde_yaml::to_writer for doing I/O, or use serde_yaml::to_string + .into_bytes() on the resulting String.

  • The serde_yaml::seed module has been removed. Now that a serde_yaml::Deserializer is publicly available, the same use cases can be addressed via seed.deserialize(Deserializer::from_str(…)) instead.

Bugfixes
  • Empty values in a mapping are supported, and deserialize to empty string when the corresponding struct field is of type string. Previously they would deserialize to "~" which makes no sense.

  • 128-bit integer deserialization now supports hex and octal input.

  • Serde_yaml now includes a mitigation against a "billion laughs" attack in which malicious input involving YAML anchors and aliases is used to consume an amount of processing or memory that is exponential in the size of the input document. Serde_yaml will quickly produce an error in this situation instead.

v0.8.26

Compare Source

v0.8.25

Compare Source

  • Add to "encoding" category on crates.io (#​246)

v0.8.24

Compare Source

  • Work around indexmap/autocfg not always properly detecting whether a std sysroot crate is available (#​243, thanks @​cuviper)

v0.8.23

Compare Source

  • Fix handling of YAML 1.1-style octals that begin with + or - sign (#​228)

v0.8.22

Compare Source

  • Switch float serializer to use the same float formatting library as serde_json

v0.8.21

Compare Source

v0.8.20

Compare Source

v0.8.19

Compare Source

v0.8.18

Compare Source

v0.8.17

Compare Source

v0.8.16

Compare Source

  • Add a Serializer and Deserializer type (#​185, #​186)

    let mut buffer = Vec::new();
    let mut ser = serde_yaml::Serializer::new(&mut buffer);
    
    let mut object = BTreeMap::new();
    object.insert("k", 107);
    object.serialize(&mut ser)?;
    
    let de = serde_yaml::Deserializer::from_slice(&buffer);
    let value = Value::deserialize(de)?;
    println!("{:?}", value);
  • Support multi-doc serialization (#​187)

    let mut buffer = Vec::new();
    let mut ser = serde_yaml::Serializer::new(&mut buffer);
    
    let mut object = BTreeMap::new();
    object.insert("k", 107);
    object.serialize(&mut ser)?;
    
    object.insert("j", 106);
    object.serialize(&mut ser)?;
    
    assert_eq!(buffer, b"---\nk: 107\n...\n---\nj: 106\nk: 107\n");
  • Support multi-doc deserialization (#​189)

    let input = "---\nk: 107\n...\n---\nj: 106\n";
    
    for document in serde_yaml::Deserializer::from_str(input) {
        let value = Value::deserialize(document)?;
        println!("{:?}", value);
    }

v0.8.15

Compare Source

  • Declare dependency version requirements compatible with minimal-versions lockfile (#​183)

v0.8.14

Compare Source

v0.8.13

Compare Source

  • Documentation improvements

v0.8.12

Compare Source

  • Add serde_yaml::mapping module containing Mapping's various iterator types: Iter, IterMut, IntoIter
  • Fix deserialization of certain strings incorrectly as NaN or infinity; only .nan and .inf and -.inf are YAML's permitted representations for NaN and infinity

v0.8.11

Compare Source

v0.8.10

Compare Source

v0.8.9

Compare Source

  • Add Value::get_mut to index into a &mut Value, returning Option

v0.8.8

Compare Source

  • Provide an implementation of Default for serde_yaml::Value which produces Value::Null (#​120, thanks @​macisamuele)

v0.8.7

Compare Source

v0.8.6

Compare Source

  • 128-bit integer support (#​110)

v0.8.5

Compare Source

v0.8.4

Compare Source

  • Limit recursion to 128 levels to avoid stack overflows (#​105)

v0.8.3

Compare Source

  • Fix possible panic during deserialization (#​101)

v0.8.2

Compare Source

  • Documentation improvements

v0.8.1

Compare Source

  • Documentation improvements

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Mend Renovate. View repository job log here.

@github-actions
Copy link

ubuntu-latest

Coverage Report

Created: 2022-07-28 21:38

Click here for information about interpreting this report.

FilenameFunction CoverageLine CoverageRegion CoverageBranch Coverage
src/apply.rs
   0.00% (0/9)
   0.00% (0/161)
   0.00% (0/109)
- (0/0)
src/cli.rs
   0.00% (0/9)
   0.00% (0/17)
   0.00% (0/10)
- (0/0)
src/config/config_base.rs
  92.00% (46/50)
  98.92% (735/743)
  91.94% (194/211)
- (0/0)
src/config/connection.rs
  70.59% (12/17)
  82.81% (53/64)
  65.71% (23/35)
- (0/0)
src/config/role.rs
  60.00% (12/20)
  72.60% (53/73)
  61.97% (44/71)
- (0/0)
src/config/role_database.rs
  66.67% (6/9)
  89.83% (53/59)
  72.50% (29/40)
- (0/0)
src/config/role_schema.rs
  66.67% (6/9)
  90.16% (55/61)
  71.79% (28/39)
- (0/0)
src/config/role_table.rs
  76.00% (19/25)
  94.92% (243/256)
  79.20% (99/125)
- (0/0)
src/config/user.rs
  90.62% (29/32)
  96.69% (146/151)
  84.06% (58/69)
- (0/0)
src/connection.rs
  75.56% (34/45)
  76.97% (421/547)
  51.58% (98/190)
- (0/0)
src/gen.rs
  70.00% (7/10)
  75.00% (66/88)
  63.89% (23/36)
- (0/0)
src/inspect.rs
   0.00% (0/16)
   0.00% (0/126)
   0.00% (0/50)
- (0/0)
src/lib.rs
 100.00% (1/1)
 100.00% (1/1)
 100.00% (1/1)
- (0/0)
src/main.rs
  50.00% (1/2)
   3.23% (1/31)
   3.85% (1/26)
- (0/0)
src/validate.rs
   0.00% (0/5)
   0.00% (0/53)
   0.00% (0/35)
- (0/0)
tests/cli-apply.rs
 100.00% (11/11)
 100.00% (80/80)
 100.00% (15/15)
- (0/0)
tests/cli-gen.rs
 100.00% (13/13)
 100.00% (64/64)
 100.00% (13/13)
- (0/0)
tests/cli-inspect.rs
 100.00% (3/3)
 100.00% (25/25)
 100.00% (3/3)
- (0/0)
tests/cli-validate.rs
 100.00% (21/21)
 100.00% (323/323)
 100.00% (21/21)
- (0/0)
Totals
  71.99% (221/307)
  79.34% (2319/2923)
  59.14% (650/1099)
- (0/0)
Generated by llvm-cov -- llvm version 14.0.5-rust-1.62.1-stable

@duyet duyet merged commit fa85841 into master Aug 27, 2022
@duyet duyet deleted the renovate/serde_yaml-0.x branch August 27, 2022 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant