fn deserialize_optional_value<'de, D, T, E>(deserializer: D) -> Result<Option<T>, D::Error>
where
    D: de::Deserializer<'de>,
    T: FromStr<Err = E>,
    E: fmt::Display,
{
    let string = Option::<String>::deserialize(deserializer).map(|str| str.unwrap_or_default())?;

    if string.is_empty() {
        return Ok(None);
    }

    string
        .parse()
        .map(Some)
        .map_err(|e| D::Error::custom(format!("{}", e)))
}
/// Deserialize `Option<T: FromStr>` where an empty string indicates `None`
Deserialize `Option` where an empty string indicates `None`
Deserialize ` Option ` where an empty string indicates ` None `
fn deserialize_optional_value<'de, D, T, E>(deserializer: D) -> Result<Option<T>, D::Error>
where
    D: de::Deserializer<'de>,
    T: FromStr<Err = E>,
    E: fmt::Display,
{
    let string = Option::<String>::deserialize(deserializer).map(|str| str.unwrap_or_default())?;
    if string.is_empty() {
        return Ok(None);
    }
    string
        .parse()
        .map(Some)
        .map_err(|e| D::Error::custom(format!("{}", e)))
}
fn deserialize_optional_value < ' de , D , T , E > ( deserializer : D ) -> Result < Option < T > , D :: Error > where D : de :: Deserializer < ' de > , T : FromStr < Err = E > , E : fmt :: Display , { let string = Option :: < String > :: deserialize ( deserializer ) . map ( | str | str . unwrap_or_default ( ) ) ? ; if string . is_empty ( ) { return Ok ( None ) ; } string . parse ( ) . map ( Some ) . map_err ( | e | D :: Error :: custom ( format ! ( " " e ) ) ) }
Deserialize `Option<T: FromStr>` where an empty string indicates `None`
Deserialize ` Option<T : FromStr > ` where an empty string indicates ` None `
deserializer
D