Skip to content

Commit d000f01

Browse files
committed
Switch from serde_yaml to serde_norway
1 parent cea8f00 commit d000f01

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

Cargo.lock

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

corn-cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ clap = { version = "4.5.31", features = ["derive"] }
1414
colored = "3.0.0"
1515
serde = { version = "1.0.218", features = ["derive"] }
1616
serde_json = "1.0.140"
17-
serde_yaml = "0.9.34"
17+
serde_norway = "0.9.42"
1818
toml_edit = { version = "0.22.24", features = ["serde"] }
1919
pest = "2.7.15"

corn-cli/src/bin/corn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn get_output_type(arg: Option<OutputType>) -> OutputType {
8383
fn serialize(config: &Value, output_type: OutputType) -> Result<String, Error> {
8484
match output_type {
8585
OutputType::Json => serde_json::to_string_pretty(&config).map_err(Error::from),
86-
OutputType::Yaml => serde_yaml::to_string(&config).map_err(Error::from),
86+
OutputType::Yaml => serde_norway::to_string(&config).map_err(Error::from),
8787
OutputType::Toml => toml_edit::ser::to_string_pretty(&config).map_err(Error::from),
8888
}
8989
}

corn-cli/src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ impl From<serde_json::Error> for Error {
5555
}
5656
}
5757

58-
impl From<serde_yaml::Error> for Error {
59-
fn from(err: serde_yaml::Error) -> Self {
58+
impl From<serde_norway::Error> for Error {
59+
fn from(err: serde_norway::Error) -> Self {
6060
Self::Serializing(err.to_string())
6161
}
6262
}

libcorn/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ paste = "1.0.15"
5252
wasm-bindgen-test = { version = "0.3.50" }
5353
# required for testing
5454
serde_json = "1.0.140"
55-
serde_yaml = "0.9.34"
55+
serde_norway = "0.9.42"
5656
serde_bytes = "0.11.16"
5757
toml_edit = { version = "0.22.24", features = ["serde"] }
5858

libcorn/tests/parser_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro_rules! generate_eq_tests {
2929
let valid = fs::read_to_string(format!("../assets/outputs/yaml/{}.yml", test_name)).unwrap().replace("\r", "");
3030

3131
let config = parse(input.as_str()).unwrap();
32-
let serialized = serde_yaml::to_string(&config).unwrap().replace("\r", "");
32+
let serialized = serde_norway::to_string(&config).unwrap().replace("\r", "");
3333

3434
assert_eq!(serialized.trim(), valid.trim());
3535
}

0 commit comments

Comments
 (0)