Open dtolnay opened 7 years ago
It would be useful to have variants in Value to hold &'de str and &'de [u8]. This enables support for borrowed data in code like the following.
&'de str
&'de [u8]
let v: Value = Deserialize::deserialize(deserializer)?; { /* some logic, inspecting or mutating the Value */ } return T::deserialize(v);
Currently in such a case T cannot borrow from the original Deserializer. This came up in https://github.com/serde-rs/serde/issues/1028.
It would be useful to have variants in Value to hold
&'de str
and&'de [u8]
. This enables support for borrowed data in code like the following.Currently in such a case T cannot borrow from the original Deserializer. This came up in https://github.com/serde-rs/serde/issues/1028.