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
Warn when code has suboptimal usage of anyhow. Specifically tell the user to use the bail! macro instead doing: return Err(anyhow!("...")).
bail!
return Err(anyhow!("..."))
Bad code
fn foo(x: bool) -> Result<()> { if x { return Err(anyhow!("x was {x}")); } Ok(()) }
Good code
fn foo(x: bool) -> Result<()> { if x { return bail!("x was {x}"); } Ok(()) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Lint explanation
Warn when code has suboptimal usage of anyhow. Specifically tell the user to use the
bail!
macro instead doing:return Err(anyhow!("..."))
.Example code
Bad code
Good code
Notes
The text was updated successfully, but these errors were encountered: