use as_deref instead of map to str
@@ -78,7 +78,7 @@ where
T: serde::Deserialize<'de>,
{
let opt = Option::<String>::deserialize(de)?;
- let opt = opt.as_ref().map(String::as_str);
+ let opt = opt.as_deref();
match opt {
None | Some("") => Ok(None),
Some(s) => T::deserialize(s.into_deserializer()).map(Some),
