#[derive(Debug, serde::Serialize, serde::Deserialize)]
struct Wrapper<'a> {
s: &'a str,
}
let w = Wrapper { s: "W" };
let cursor = Cursor::new(bincode::serialize(&w).unwrap());
let op = options().with_fixint_encoding().allow_trailing_bytes();
let mut des = bincode::de::Deserializer::with_reader(cursor, op);
let _: Wrapper = serde::Deserialize::deserialize(&mut des).unwrap(); // Fails here
The error messages says:
panicked at 'called `Result::unwrap()` on an `Err` value: Custom("invalid type: string \"W\", expected a borrowed string")'
Interestingly changing the from_reader + cursor approach to from_slice works fine
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The error messages says:
panicked at 'called `Result::unwrap()` on an `Err` value: Custom("invalid type: string \"W\", expected a borrowed string")'
Interestingly changing the from_reader + cursor approach to from_slice works fine