Update example on ruma_serde::empty_string_as_none

This commit is contained in:
Jonas Platte 2021-11-02 14:37:45 +01:00
parent 56801780b6
commit c00518599e
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -15,7 +15,7 @@ use serde::{
/// formulation in the spec. /// formulation in the spec.
/// ///
/// To be used like this: /// To be used like this:
/// `#[serde(deserialize_with = "empty_string_as_none")]` /// `#[serde(default, deserialize_with = "empty_string_as_none")]`
/// Relevant serde issue: <https://github.com/serde-rs/serde/issues/1425> /// Relevant serde issue: <https://github.com/serde-rs/serde/issues/1425>
pub fn empty_string_as_none<'de, D, T>(de: D) -> Result<Option<T>, D::Error> pub fn empty_string_as_none<'de, D, T>(de: D) -> Result<Option<T>, D::Error>
where where