diff --git a/tools/pubsys-config/src/lib.rs b/tools/pubsys-config/src/lib.rs index 8b244977e..5f9a1848a 100644 --- a/tools/pubsys-config/src/lib.rs +++ b/tools/pubsys-config/src/lib.rs @@ -241,8 +241,8 @@ fn deserialize_offset<'de, D>(deserializer: D) -> std::result::Result, { - let s: &str = Deserialize::deserialize(deserializer)?; - parse_offset(s).map_err(serde::de::Error::custom) + let s: String = Deserialize::deserialize(deserializer)?; + parse_offset(&s).map_err(serde::de::Error::custom) } mod error { @@ -277,3 +277,14 @@ mod error { } pub use error::Error; pub type Result = std::result::Result; + +#[test] +fn repo_expiration_deserialization_test() { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("..") + .join("pubsys") + .join("policies") + .join("repo-expiration") + .join("2w-2w-1w.toml"); + let _ = RepoExpirationPolicy::from_path(path).unwrap(); +}