Because apparently serde_json
only deserializes through a referenceā¢.
```rust use serde::{Deserialize, Deserializer}; use ownedjsondeserializer::OwnedJsonDeserializer;
struct Wave { hi: String, }
fn gimmeadeserializer(sayhito: String) -> impl Deserializer<'static> { OwnedJsonDeserializer::fromstring( format!(r#"{{ "hi": "{}" }}"#, sayhi_to) ) }
fn main() { let deserializer = gimmeadeserializer("mom".tostring()); let wave = Wave::deserialize(deserializer).unwrap(); asserteq!(wave.hi, "mom"); } ```
This crate is dual-licensed under either:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.