ruma::serde

Function none_as_default

Source
pub fn none_as_default<'de, D, T>(
    deserializer: D,
) -> Result<T, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>, T: Default + Deserialize<'de>,
Expand description

Deserialize a T via Option<T>, falling back to T::default().