This code:
#[derive(serde::Deserialize)]
struct Test {
a: i32,
b: i32,
}
let string = r#"Test(
a: 1 // <-- forgetten comma here
b: 2
)"#;
ron::from_str::<Test>(string).unwrap();
Produces the following error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: Message("missing field `b`"), position: Position { col: 0, line: 0 } }', src/main.rs:67:35
Which is really hard to understand because
- it says field
b is missing but it doesn't
- it doesn't say anything about commas
- it points to
0, 0
This code:
Produces the following error:
Which is really hard to understand because
bis missing but it doesn't0, 0