Function ruma::serde::deserialize_cow_str

source ·
pub fn deserialize_cow_str<'de, D>(
    deserializer: D,
) -> Result<Cow<'de, str>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,
Expand description

Deserialize a Cow<'de, str>.

Different from serde’s implementation of Deserialize for Cow since it borrows from the input when possible.

This will become unnecessary if Rust gains lifetime specialization at some point; see https://github.com/serde-rs/serde/issues/1497#issuecomment-716246686.