The issue is well described here: https://users.rust-lang.org/t/serde-toml-error-reporting/127521
When using
let val = toml::from_slice(&bytes).unwrap();
the terminal output is very verbose and hard to read.
Doing it as:
let val: EventFile = match toml::from_slice(&bytes) {
Ok(s) => s,
Err(e) => panic!("{e}"),
};
yields the expected beautiful and readable output, which makes it easy to find where the parse issue occurred in the toml file. But this makes the code a bit needlessly verbose.
I think it would be ideal if, like with serde_json, unwrap produced the terse output.
The issue is well described here: https://users.rust-lang.org/t/serde-toml-error-reporting/127521
When using
the terminal output is very verbose and hard to read.
Doing it as:
yields the expected beautiful and readable output, which makes it easy to find where the parse issue occurred in the toml file. But this makes the code a bit needlessly verbose.
I think it would be ideal if, like with
serde_json, unwrap produced the terse output.