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
#[instrument(err)]
clippy::blocks_in_conditions
#[async_trait]
Here is sample well-formed code that shouldn't trigger clippy lints:
#[async_trait::async_trait] pub trait Foo { #[tracing::instrument(err)] async fn bar() -> Result<(), &'static str> { Ok(()) } }
When you give it to clippy you'll see a warning:
$ cargo +nightly clippy Checking sandbox v0.1.0 (/home/veetaha/sandbox/rust/crates/sandbox) warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let` --> crates/sandbox/src/lib.rs:4:48 | 4 | async fn bar() -> Result<(), &'static str> { | ________________________________________________^ 5 | | Ok(()) 6 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions = note: `#[warn(clippy::blocks_in_conditions)]` on by default warning: `sandbox` (lib) generated 1 warning Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
cargo 1.78.0-nightly (a4c63fe53 2024-03-06)
cargo tree | rg 'tracing|async-trait' ├── async-trait v0.1.77 (proc-macro) ├── tracing v0.1.40 │ ├── tracing-attributes v0.1.27 (proc-macro) │ └── tracing-core v0.1.32 └── tracing-core v0.1.32 (*)
uname -a Linux devbox-vkryvenko 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
This has been fixed by #2880
Sorry, something went wrong.
No branches or pull requests
Reproduction
Here is sample well-formed code that shouldn't trigger clippy lints:
When you give it to clippy you'll see a warning:
Version
Platform
The text was updated successfully, but these errors were encountered: