mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 06:18:31 +00:00
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:
@@ -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)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user