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

Replace deprecated failure crate with anyhow #1150

Merged
merged 1 commit into from
Dec 17, 2023

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Dec 17, 2023

failure is risky to use in modern code because its formatting macros are not compatible with https://rust-lang.github.io/rfcs/2795-format-args-implicit-identifiers.html.

fn main() {
    if let Err(err) = do_main() {
        eprintln!("{}", err);
    }
}

fn do_main() -> Result<(), failure::Error> {
    let person = "dtolnay";
    failure::bail!("person {person}");
    Ok(())
}

Output:

person {person}

@Mark-Simulacrum Mark-Simulacrum merged commit c2a5379 into rust-lang:master Dec 17, 2023
1 check passed
@dtolnay dtolnay deleted the anyhow branch December 17, 2023 20:40
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