fn empty_path_is_none<'de, D, T>(deserializer: D) -> Result<Option<T>, D::Error>
where
    D: Deserializer<'de>,
    T: From<PathBuf>,
{
    let s = PathBuf::deserialize(deserializer)?;
    if s.as_os_str().is_empty() {
        Ok(None)
    } else {
        Ok(Some(s.into()))
    }
}
// Serde seems broken with OsString for some reason
Serde seems broken with OsString for some reason
Serde seems broken with OsString for some reason
fn empty_path_is_none<'de, D, T>(deserializer: D) -> Result<Option<T>, D::Error>
where
    D: Deserializer<'de>,
    T: From<PathBuf>,
{
    let s = PathBuf::deserialize(deserializer)?;
    if s.as_os_str().is_empty() {
        Ok(None)
    } else {
        Ok(Some(s.into()))
    }
}
fn empty_path_is_none < ' de , D , T > ( deserializer : D ) -> Result < Option < T > , D :: Error > where D : Deserializer < ' de > , T : From < PathBuf > , { let s = PathBuf :: deserialize ( deserializer ) ? ; if s . as_os_str ( ) . is_empty ( ) { Ok ( None ) } else { Ok ( Some ( s . into ( ) ) ) } }
Serde seems broken with OsString for some reason
Serde seems broken with OsString for some reason
deserializer
D
deserializer
D