Skip to content

Commit

Permalink
Merge pull request mehcode#554 from 0rzech/yaml-rust2-dependency
Browse files Browse the repository at this point in the history
Switch from yaml-rust to yaml-rust2 dependency
  • Loading branch information
matthiasbeyer committed Mar 27, 2024
2 parents 4896caf + c477859 commit e3c1d0b
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 20 deletions.
75 changes: 64 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ maintenance = { status = "actively-developed" }
[features]
default = ["toml", "json", "yaml", "ini", "ron", "json5", "convert-case", "async"]
json = ["serde_json"]
yaml = ["yaml-rust"]
yaml = ["yaml-rust2"]
ini = ["rust-ini"]
json5 = ["json5_rs", "serde/derive"]
convert-case = ["convert_case"]
Expand All @@ -32,7 +32,7 @@ nom = "7"
async-trait = { version = "0.1", optional = true }
toml = { version = "0.8", optional = true }
serde_json = { version = "1.0", optional = true }
yaml-rust = { version = "0.4", optional = true }
yaml-rust2 = { version = "0.8", optional = true }
rust-ini = { version = "0.20", optional = true }
ron = { version = "0.8", optional = true }
json5_rs = { version = "0.4", optional = true, package = "json5" }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

[JSON]: https://github.com/serde-rs/json
[TOML]: https://github.com/toml-lang/toml
[YAML]: https://github.com/chyh1990/yaml-rust
[YAML]: https://github.com/Ethiraric/yaml-rust2
[INI]: https://github.com/zonyitoo/rust-ini
[RON]: https://github.com/ron-rs/ron
[JSON5]: https://github.com/callum-oakley/json5-rs
Expand Down
2 changes: 1 addition & 1 deletion src/file/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum FileFormat {
#[cfg(feature = "json")]
Json,

/// YAML (parsed with yaml_rust)
/// YAML (parsed with yaml_rust2)
#[cfg(feature = "yaml")]
Yaml,

Expand Down
2 changes: 1 addition & 1 deletion src/file/format/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::error::Error;
use std::fmt;
use std::mem;

use yaml_rust as yaml;
use yaml_rust2 as yaml;

use crate::format;
use crate::map::Map;
Expand Down
3 changes: 1 addition & 2 deletions tests/file_yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ fn test_error_parse() {
assert_eq!(
res.unwrap_err().to_string(),
format!(
"while parsing a block mapping, did not find expected key at \
line 2 column 1 in {}",
"simple key expect ':' at byte 21 line 3 column 1 in {}",
path_with_extension.display()
)
);
Expand Down
3 changes: 1 addition & 2 deletions tests/legacy/file_yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ fn test_error_parse() {
assert_eq!(
res.unwrap_err().to_string(),
format!(
"while parsing a block mapping, did not find expected key at \
line 2 column 1 in {}",
"simple key expect ':' at byte 21 line 3 column 1 in {}",
path_with_extension.display()
)
);
Expand Down

0 comments on commit e3c1d0b

Please sign in to comment.