Skip to content

Commit

Permalink
Use deprecated serde_yaml in cli (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko authored Jan 27, 2025
1 parent c941c0b commit 9b357f9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to MiniJinja are documented here.
it now ensures that the iterator is not running "one item ahead". #677
- Fixed an issue that caused loop aliasing not to be supported for
recursive loops. #678
- CLI moved from `serde_yml` to `serde_yaml`. #684

## 2.6.0

Expand Down
26 changes: 11 additions & 15 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 minijinja-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rust-version = "1.65"

[features]
default = ["toml", "yaml", "querystring", "cbor", "datetime", "json5", "repl", "completions", "unicode", "ini", "contrib", "preserve_order"]
yaml = ["serde_yml"]
yaml = ["serde_yaml"]
querystring = ["serde_qs"]
cbor = ["ciborium"]
datetime = ["minijinja-contrib/datetime", "minijinja-contrib/timezone"]
Expand Down Expand Up @@ -52,7 +52,7 @@ serde = { version = "1.0.183", features = ["derive", "rc"] }
serde_json = "1.0.105"
serde_json5 = { version = "0.1.0", optional = true }
serde_qs = { version = "0.12.0", optional = true }
serde_yml = { version = "0.0.10", optional = true }
serde_yaml = { version = "0.9.34", optional = true }
tempfile = "3.9.0"
toml = { version = "0.7.6", optional = true }
clap_complete = { version = "4", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions minijinja-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ fn load_data(
#[cfg(feature = "yaml")]
"yaml" => {
// for merge keys to work we need to manually call `apply_merge`.
// For this reason we need to deserialize into a serde_yml::Value
// For this reason we need to deserialize into a serde_yaml::Value
// before converting it into a final value.
let mut v: serde_yml::Value = serde_yml::from_slice(&contents)?;
let mut v: serde_yaml::Value = serde_yaml::from_slice(&contents)?;
v.apply_merge()?;
Value::from_serialize(v)
}
Expand Down
2 changes: 1 addition & 1 deletion minijinja-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fn interpret_raw_value(s: &str) -> Result<Value, Error> {
}
#[cfg(feature = "yaml")]
mod imp {
pub use serde_yml::from_str;
pub use serde_yaml::from_str;
pub const FMT: &str = "JSON";
}
imp::from_str::<Value>(s)
Expand Down

0 comments on commit 9b357f9

Please sign in to comment.