Skip to content

Commit

Permalink
Merge branch 'master' into singletonmap
Browse files Browse the repository at this point in the history
This pull request was a little behind the `master` branch. I'm merging
`master` back in, because I don't like rebasing or modifying public
commits.

I want to have clean tests before I merge this pull request
into master. But I still haven't figured out a way to run the tests
locally. See more information in fd53474. I'm basically using github
actions as a test runner... This is bad, but temporary.
  • Loading branch information
acatton committed May 26, 2024
2 parents ab4f4df + fd53474 commit 4bd0314
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Serde YAML
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/acatton/serde-yaml-ng/ci.yml?branch=master&style=for-the-badge" height="20">](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`.
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//! <br>
//!
//! 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/
Expand Down
4 changes: 2 additions & 2 deletions src/value/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4bd0314

Please sign in to comment.