rust/tests/ui/redundant_closure_call_fixable.fixed
Aaron Christiansen 4c43aa7053 Fix suggestion for async in redundant_closure_call
Fix redundant_closure_call for single-expression async closures

Add Sugg::asyncify

Use Sugg for redundant_closure_call implementation
2022-07-15 15:49:04 +01:00

29 lines
448 B
Rust

// run-rustfix
#![feature(async_closure)]
#![warn(clippy::redundant_closure_call)]
#![allow(unused)]
async fn something() -> u32 {
21
}
async fn something_else() -> u32 {
2
}
fn main() {
let a = 42;
let b = async {
let x = something().await;
let y = something_else().await;
x * y
};
let c = {
let x = 21;
let y = 2;
x * y
};
let d = async { something().await };
}