Skip to content

Overly verbose output error message on .unwrap() #1091

@Satellile

Description

@Satellile

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions