We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#![allow(dead_code, unused_variables)] use std::collections::HashMap; #[derive(Debug, serde::Deserialize)] struct Config { foo: Option<String>, #[serde(flatten)] other: HashMap<String, usize>, } fn main() { let src = r#" aaa: 1 bbb: true ccc: 3 ddd: 4 # and # a # lot # more # lines foo: bar "#; dbg!(deser_hjson::from_str::<HashMap<String, usize>>(src)); dbg!(deser_hjson::from_str::<Config>(src)); }
The first message is what I expected to see for both calls to from_str():
from_str()
[src/main.rs:25:2] deser_hjson::from_str::<HashMap<String, usize>>(src) = Err( Syntax { line: 3, col: 7, code: ExpectedU64, at: "true\n\tccc: 3\n\td", }, )
The second one always seem to point at the last line of the input:
[src/main.rs:26:2] deser_hjson::from_str::<Config>(src) = Err( Serde { line: 12, col: 2, message: "invalid type: boolean `true`, expected usize", }, )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The first message is what I expected to see for both calls to
from_str()
:The second one always seem to point at the last line of the input:
The text was updated successfully, but these errors were encountered: