use serde::{Deserialize, Deserializer}; /// Deserializes `null`able value by placing the [`Default`] value instead of `null`. pub(crate) fn default_for_null<'de, D, T>(deserializer: D) -> Result where D: Deserializer<'de>, T: Deserialize<'de> + Default, { Ok(Option::::deserialize(deserializer)?.unwrap_or_default()) }