Skip to content
New issue

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

Remove Debug nesting in errors that only contain an inner error #820

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Dec 13, 2024

fn main() {
    println!("{:#?}", toml::from_str::<i32>("").unwrap_err());
}

Before:

Error {
    inner: Error {
        inner: TomlError {
            message: "invalid type: map, expected i32",
            raw: Some(
                "",
            ),
            keys: [],
            span: Some(
                0..0,
            ),
        },
    },
}

After:

TomlError {
    message: "invalid type: map, expected i32",
    raw: Some(
        "",
    ),
    keys: [],
    span: Some(
        0..0,
    ),
}

println!("{:#?}", toml::from_str::<i32>("").unwrap_err());

Before:

    Error {
        inner: Error {
            inner: TomlError {
                message: "invalid type: map, expected i32",
                raw: Some(
                    "",
                ),
                keys: [],
                span: Some(
                    0..0,
                ),
            },
        },
    }

After:

    TomlError {
        message: "invalid type: map, expected i32",
        raw: Some(
            "",
        ),
        keys: [],
        span: Some(
            0..0,
        ),
    }
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12324386302

Details

  • 0 of 6 (0.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.07%) to 67.983%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/toml/src/de.rs 0 2 0.0%
crates/toml/src/ser.rs 0 2 0.0%
crates/toml_edit/src/de/mod.rs 0 2 0.0%
Totals Coverage Status
Change from base Build 12146327906: -0.07%
Covered Lines: 3752
Relevant Lines: 5519

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants