serde icon indicating copy to clipboard operation
serde copied to clipboard

Bad message for struct deserialized from array that is too long

Open dtolnay opened this issue 8 years ago • 1 comments

#[macro_use]
extern crate serde_derive;
extern crate serde_json;

#[derive(Deserialize, Debug)]
struct S {
    a: u8,
}

fn main() {
    println!("{}", serde_json::from_str::<S>("[0, 0]").unwrap_err());
}

trailing characters at line 1 column 3

Let's match the message from #981 if possible.

dtolnay avatar Jul 09 '17 16:07 dtolnay

It seems that this issue should be moved to https://github.com/serde-rs/json

Mingun avatar Aug 11 '23 17:08 Mingun