Skip to content

Commit 6eb3c34

Browse files
authored
Switch serde_yaml to yaml_serde (#138)
serde_yaml has been deprecated as unsupported. yaml_serde seems to be the successor package. Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
1 parent 1758c1d commit 6eb3c34

6 files changed

Lines changed: 26 additions & 26 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ prometheus-parse = "0.2.5"
3232
reqwest = "0.11"
3333
serde = "1"
3434
serde_json = "1"
35-
serde_yaml = "0.9"
3635
serial_test = "3.2"
3736
sysinfo = "0.29"
3837
test-case = "3.3"
@@ -42,6 +41,7 @@ tower = "0.5"
4241
tower-http = "0.6"
4342
tracing = "0.1"
4443
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
44+
yaml_serde = "0.10"
4545

4646
[profile.release]
4747
lto = true

lustre-collector/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ clap = { workspace = true, features = ["derive"] }
1111
combine.workspace = true
1212
serde = { workspace = true, features = ["derive"] }
1313
serde_json.workspace = true
14-
serde_yaml.workspace = true
1514
thiserror.workspace = true
1615
tracing.workspace = true
1716
tracing-subscriber.workspace = true
17+
yaml_serde.workspace = true
1818

1919
[dev-dependencies]
2020
include_dir.workspace = true

lustre-collector/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub enum LustreCollectorError {
1313
#[error(transparent)]
1414
SerdeJsonError(#[from] serde_json::error::Error),
1515
#[error(transparent)]
16-
SerdeYamlError(#[from] serde_yaml::Error),
16+
SerdeYamlError(#[from] yaml_serde::Error),
1717
#[error(transparent)]
1818
StringStreamError(#[from] StringStreamError),
1919
#[error(transparent)]

lustre-collector/src/lnetctl_parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn parse(xs: &[u8]) -> Result<Vec<Record>, LustreCollectorError> {
4646
return Ok(vec![]);
4747
}
4848

49-
let y: LnetNetStats = serde_yaml::from_slice(xs)?;
49+
let y: LnetNetStats = yaml_serde::from_slice(xs)?;
5050

5151
Ok(y.net
5252
.map(|xs| {
@@ -89,7 +89,7 @@ pub fn parse_lnetctl_stats(xs: &[u8]) -> Result<Vec<Record>, LustreCollectorErro
8989
return Ok(vec![]);
9090
}
9191

92-
let y: LnetStats = serde_yaml::from_slice(xs)?;
92+
let y: LnetStats = yaml_serde::from_slice(xs)?;
9393

9494
Ok(y.statistics
9595
.map(|x| build_lnetctl_stats(&x))

lustre-collector/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn run() -> Result<(), LustreCollectorError> {
179179

180180
let x = match format {
181181
Format::Json => serde_json::to_string(&lctl_record)?,
182-
Format::Yaml => serde_yaml::to_string(&lctl_record)?,
182+
Format::Yaml => yaml_serde::to_string(&lctl_record)?,
183183
};
184184

185185
println!("{x}");

0 commit comments

Comments
 (0)