From 6757abef2accd4e0c05db9bc7a855c41aad7f530 Mon Sep 17 00:00:00 2001 From: Antoine Catton Date: Fri, 24 May 2024 18:52:47 +0200 Subject: [PATCH 1/3] Document the currently supported YAML version. This fixes #2 --- README.md | 2 +- src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31310ec..b4e8544 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Serde YAML [build status](https://github.com/acatton/serde-yaml-ng/actions?query=branch%3Amaster) Rust library for using the [Serde] serialization framework with data in [YAML] -file format. +file format. This library only follows the [YAML specification 1.1.](https://yaml.org/spec/1.1/). This library is a fork from the latest commit of [serde-yaml](https://github.com/dtolnay/serde-yaml), which was `200950`. diff --git a/src/lib.rs b/src/lib.rs index a63fe8f..7428a98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,9 @@ //!
//! //! Rust library for using the [Serde] serialization framework with data in -//! [YAML] file format. _(This project is no longer maintained.)_ +//! [YAML] file format. +//! +//! This version only support the [YAML Specification 1.1](https://yaml.org/spec/1.1/) //! //! [Serde]: https://github.com/serde-rs/serde //! [YAML]: https://yaml.org/ From a3630297c8b5356cad53a5f7dc4d7adaabeb4e61 Mon Sep 17 00:00:00 2001 From: Antoine Catton Date: Fri, 24 May 2024 19:03:32 +0200 Subject: [PATCH 2/3] Implement code fixes suggested by clippy nightly This should make the CI happy. --- src/value/index.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/value/index.rs b/src/value/index.rs index 5c11c12..82de731 100644 --- a/src/value/index.rs +++ b/src/value/index.rs @@ -29,14 +29,14 @@ impl Index for usize { fn index_into<'v>(&self, v: &'v Value) -> Option<&'v Value> { match v.untag_ref() { Value::Sequence(vec) => vec.get(*self), - Value::Mapping(vec) => vec.get(&Value::Number((*self).into())), + Value::Mapping(vec) => vec.get(Value::Number((*self).into())), _ => None, } } fn index_into_mut<'v>(&self, v: &'v mut Value) -> Option<&'v mut Value> { match v.untag_mut() { Value::Sequence(vec) => vec.get_mut(*self), - Value::Mapping(vec) => vec.get_mut(&Value::Number((*self).into())), + Value::Mapping(vec) => vec.get_mut(Value::Number((*self).into())), _ => None, } } From fd5347429e9c5e1da7ae0d3b4427c2bdddd27378 Mon Sep 17 00:00:00 2001 From: Antoine Catton Date: Fri, 24 May 2024 19:13:03 +0200 Subject: [PATCH 3/3] Fix the last issue raised by clippy nightly I'm sorry about the noisy git history. I just hate force-pushing, as I find it rude, you're just overrideing other people's history. Once you publish it's for life. Anyway, I'm not able these tests locally for now, so my only feedback is github actions. And I've messed up in a3630297c and missed this part. I'll work in running these test in a container next time. --- tests/test_value.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_value.rs b/tests/test_value.rs index 16681bc..5a492db 100644 --- a/tests/test_value.rs +++ b/tests/test_value.rs @@ -143,7 +143,7 @@ fn test_tagged() { Variant(usize), } - let value = serde_yaml_ng::to_value(&Enum::Variant(0)).unwrap(); + let value = serde_yaml_ng::to_value(Enum::Variant(0)).unwrap(); let deserialized: serde_yaml_ng::Value = serde_yaml_ng::from_value(value.clone()).unwrap(); assert_eq!(value, deserialized);