Closed Canop closed 3 years ago
You're right, it's almost never possible to borrow any part from the initial string as escaping can occur everywhere.
I made a new version 1.1.10 with DeserializeOwned
.
Note that that change would have been a breaking change. Previously correct working code like the following would be broken by your 0.1.10 release.
fn f<'de, T: serde::Deserialize<'de> + std::fmt::Display>() {
println!("{}", deser_hjson::from_str::<T>("1 ").unwrap());
}
fn main() {
f::<i32>();
}
Thanks for the note. Now that it's "official" and might be used more largely, I'll be serious with breaking changes and I'll make a changelog for the next versions.
Another crate, hjson-rust was listed in the past for Hjson but hadn't been made compatible with serde 1.0 and isn't compatible with derive based operations.
This new crate, deser-hjson is explicitly geared at derive based deserialization.