about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/unnecessary_lazy_eval_unfixable.stderr
blob: 5174acc1e9f951d2407bb373b9d22a9842a34022 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
error: unnecessary closure used to substitute value for `Result::Err`
  --> tests/ui/unnecessary_lazy_eval_unfixable.rs:13:13
   |
LL |     let _ = Ok(1).unwrap_or_else(|()| 2);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`
help: use `unwrap_or` instead
   |
LL -     let _ = Ok(1).unwrap_or_else(|()| 2);
LL +     let _ = Ok(1).unwrap_or(2);
   |

error: unnecessary closure used to substitute value for `Result::Err`
  --> tests/ui/unnecessary_lazy_eval_unfixable.rs:19:13
   |
LL |     let _ = Ok(1).unwrap_or_else(|e::E| 2);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: use `unwrap_or` instead
   |
LL -     let _ = Ok(1).unwrap_or_else(|e::E| 2);
LL +     let _ = Ok(1).unwrap_or(2);
   |

error: unnecessary closure used to substitute value for `Result::Err`
  --> tests/ui/unnecessary_lazy_eval_unfixable.rs:22:13
   |
LL |     let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: use `unwrap_or` instead
   |
LL -     let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
LL +     let _ = Ok(1).unwrap_or(2);
   |

error: unnecessary closure used with `bool::then`
  --> tests/ui/unnecessary_lazy_eval_unfixable.rs:32:13
   |
LL |     let _ = true.then(|| -> &[u8] { &[] });
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: use `then_some` instead
   |
LL -     let _ = true.then(|| -> &[u8] { &[] });
LL +     let _ = true.then_some({ &[] });
   |

error: aborting due to 4 previous errors