Closed dtolnay closed 1 year ago
Example:
use serde::Deserialize; #[derive(Deserialize)] pub struct Struct { pub x: i32, } fn main() -> anyhow::Result<()> { let j = "{\"x\":true}"; let mut de = serde_json::Deserializer::from_str(j); let _: Struct = serde_path_to_error::deserialize(&mut de)?; Ok(()) }
Previously this would print:
Error: x: invalid type: boolean `true`, expected i32 at line 1 column 9 Caused by: invalid type: boolean `true`, expected i32 at line 1 column 9
In general, std::error::Error impls are not supposed to duplicate the same content between their Display and source() implementation.
std::error::Error
Display
source()
Example:
Previously this would print:
In general,
std::error::Error
impls are not supposed to duplicate the same content between theirDisplay
andsource()
implementation.