error: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> ...:1515:49
|
1515 | async fn foo(&self) -> Result<usize, usize> {
| _________________________________________________^
1516 | | Ok(8)
1517 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
This only happens with async traits. The following caused no errors:
Bug Report
Version
tracing v0.1.40 tracing-attributes v0.1.27 (proc-macro) tracing-core v0.1.32 tracing-futures v0.2.5 tracing-log v0.2.0 tracing-subscriber v0.3.18
Platform
22.04.1-Ubuntu
Description
Running the following code with clippy version 1.76.0 (2024-02-04) caused an error
The error is
This only happens with async traits. The following caused no errors: