Use yaml_serde in place of deprecated serde_yaml (#9040)

`serde_yaml` is now deprecated. The API-compatible `yaml_serde` should be used instead.


  Replace `serde_yaml` with `yaml_serde`. This is purely mechanical as the API is 1-to-1.


Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
Mac L
2026-03-29 22:39:20 +04:00
committed by GitHub
parent e1a2cfe202
commit a5e748f808
27 changed files with 88 additions and 87 deletions

View File

@@ -33,14 +33,14 @@ pub fn log_file_access<P: AsRef<Path>>(file_accessed: P) {
}
pub fn yaml_decode<T: serde::de::DeserializeOwned>(string: &str) -> Result<T, Error> {
serde_yaml::from_str(string).map_err(|e| Error::FailedToParseTest(format!("{:?}", e)))
yaml_serde::from_str(string).map_err(|e| Error::FailedToParseTest(format!("{:?}", e)))
}
pub fn context_yaml_decode<'de, T, C>(string: &'de str, context: C) -> Result<T, Error>
where
T: ContextDeserialize<'de, C>,
{
let deserializer = serde_yaml::Deserializer::from_str(string);
let deserializer = yaml_serde::Deserializer::from_str(string);
T::context_deserialize(deserializer, context)
.map_err(|e| Error::FailedToParseTest(format!("{:?}", e)))
}