]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/redundant_closure_call_fixable.fixed
Auto merge of #101969 - reez12g:issue-101306, r=reez12g
[rust.git] / src / tools / clippy / tests / ui / redundant_closure_call_fixable.fixed
1 // run-rustfix
2
3 #![feature(async_closure)]
4 #![warn(clippy::redundant_closure_call)]
5 #![allow(unused)]
6
7 async fn something() -> u32 {
8     21
9 }
10
11 async fn something_else() -> u32 {
12     2
13 }
14
15 fn main() {
16     let a = 42;
17     let b = async {
18         let x = something().await;
19         let y = something_else().await;
20         x * y
21     };
22     let c = {
23         let x = 21;
24         let y = 2;
25         x * y
26     };
27     let d = async { something().await };
28 }