Skip to content

Commit 6be4f0d

Browse files
committed
switch from serde_yml to serde_norway
1 parent 8999148 commit 6be4f0d

File tree

5 files changed

+27
-33
lines changed

5 files changed

+27
-33
lines changed

Cargo.lock

Lines changed: 20 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

application/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ colored = "3.0.0"
2424
chrono = { workspace = true }
2525
nestify = "0.3.3"
2626
rayon = "1.10.0"
27-
serde_yml = "0.0.12"
27+
serde_norway = "0.9.42"
2828
serde_default = "0.2.0"
2929
futures-util = { workspace = true }
3030
tokio-util = { workspace = true }

application/src/commands/configure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub async fn configure(
4242
}
4343
};
4444

45-
let response = match serde_yml::from_slice(&decoded) {
45+
let response = match serde_norway::from_slice(&decoded) {
4646
Ok(response) => response,
4747
Err(_) => {
4848
eprintln!("failed to decode join data!");

application/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ impl Config {
946946
) -> Result<(Arc<Self>, ConfigGuard), anyhow::Error> {
947947
let file = File::open(path).context(format!("failed to open config file {path}"))?;
948948
let reader = std::io::BufReader::new(file);
949-
let config: InnerConfig = serde_yml::from_reader(reader)
949+
let config: InnerConfig = serde_norway::from_reader(reader)
950950
.context(format!("failed to parse config file {path}"))?;
951951

952952
let client = crate::remote::client::Client::new(&config, ignore_certificate_errors);
@@ -1022,7 +1022,7 @@ impl Config {
10221022
}
10231023
let file = File::create(path).context(format!("failed to create config file {path}"))?;
10241024
let writer = std::io::BufWriter::new(file);
1025-
serde_yml::to_writer(writer, &config)
1025+
serde_norway::to_writer(writer, &config)
10261026
.context(format!("failed to write config file {path}"))?;
10271027

10281028
Ok(())
@@ -1034,7 +1034,7 @@ impl Config {
10341034
let file = File::create(&self.path)
10351035
.context(format!("failed to create config file {}", self.path))?;
10361036
let writer = std::io::BufWriter::new(file);
1037-
serde_yml::to_writer(writer, unsafe { &*self.inner.get() })
1037+
serde_norway::to_writer(writer, unsafe { &*self.inner.get() })
10381038
.context(format!("failed to write config file {}", self.path))?;
10391039

10401040
Ok(())

application/src/server/configuration/process/yaml.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl super::ProcessConfigurationFileParser for YamlFileParser {
1717
let mut json: serde_json::Value = if content.trim().is_empty() {
1818
serde_json::Value::Object(serde_json::Map::new())
1919
} else {
20-
serde_yml::from_str(content)
20+
serde_norway::from_str(content)
2121
.unwrap_or_else(|_| serde_json::Value::Object(serde_json::Map::new()))
2222
};
2323

@@ -46,6 +46,6 @@ impl super::ProcessConfigurationFileParser for YamlFileParser {
4646
);
4747
}
4848

49-
Ok(serde_yml::to_string(&json)?.into_bytes())
49+
Ok(serde_norway::to_string(&json)?.into_bytes())
5050
}
5151
}

0 commit comments

Comments
 (0)