|
1 | 1 | error: called `Option::take()` on a temporary value |
2 | | - --> tests/ui/needless_option_take.rs:12:5 |
| 2 | + --> tests/ui/needless_option_take.rs:23:5 |
3 | 3 | | |
4 | 4 | LL | x.as_ref().take(); |
5 | | - | ^^^^^^^^^^^^^^^^^ help: try: `x.as_ref()` |
| 5 | + | ^^^^^^^^^^^^^^^^^ |
6 | 6 | | |
| 7 | +note: `as_ref` creates a temporary value |
| 8 | + --> tests/ui/needless_option_take.rs:23:5 |
| 9 | + | |
| 10 | +LL | x.as_ref().take(); |
| 11 | + | ^^^^^^^^^^ |
7 | 12 | = note: `-D clippy::needless-option-take` implied by `-D warnings` |
8 | 13 | = help: to override `-D warnings` add `#[allow(clippy::needless_option_take)]` |
9 | 14 |
|
10 | | -error: aborting due to 1 previous error |
| 15 | +error: called `Option::take()` on a temporary value |
| 16 | + --> tests/ui/needless_option_take.rs:31:13 |
| 17 | + | |
| 18 | +LL | let y = x.as_mut().take(); |
| 19 | + | ^^^^^^^^^^^^^^^^^ |
| 20 | + | |
| 21 | +note: `as_mut` creates a temporary value |
| 22 | + --> tests/ui/needless_option_take.rs:31:13 |
| 23 | + | |
| 24 | +LL | let y = x.as_mut().take(); |
| 25 | + | ^^^^^^^^^^ |
| 26 | + |
| 27 | +error: called `Option::take()` on a temporary value |
| 28 | + --> tests/ui/needless_option_take.rs:33:13 |
| 29 | + | |
| 30 | +LL | let y = x.replace(289).take(); |
| 31 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 32 | + | |
| 33 | +note: `replace` creates a temporary value |
| 34 | + --> tests/ui/needless_option_take.rs:33:13 |
| 35 | + | |
| 36 | +LL | let y = x.replace(289).take(); |
| 37 | + | ^^^^^^^^^^^^^^ |
| 38 | + |
| 39 | +error: called `Option::take()` on a temporary value |
| 40 | + --> tests/ui/needless_option_take.rs:36:13 |
| 41 | + | |
| 42 | +LL | let y = Some(3).as_mut().take(); |
| 43 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 44 | + | |
| 45 | +note: `as_mut` creates a temporary value |
| 46 | + --> tests/ui/needless_option_take.rs:36:13 |
| 47 | + | |
| 48 | +LL | let y = Some(3).as_mut().take(); |
| 49 | + | ^^^^^^^^^^^^^^^^ |
| 50 | + |
| 51 | +error: called `Option::take()` on a temporary value |
| 52 | + --> tests/ui/needless_option_take.rs:39:13 |
| 53 | + | |
| 54 | +LL | let y = Option::as_mut(&mut x).take(); |
| 55 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 56 | + | |
| 57 | +note: `as_mut` creates a temporary value |
| 58 | + --> tests/ui/needless_option_take.rs:39:13 |
| 59 | + | |
| 60 | +LL | let y = Option::as_mut(&mut x).take(); |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 62 | + |
| 63 | +error: called `Option::take()` on a temporary value |
| 64 | + --> tests/ui/needless_option_take.rs:43:13 |
| 65 | + | |
| 66 | +LL | let x = return_option().take(); |
| 67 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 68 | + | |
| 69 | +note: `return_option` creates a temporary value |
| 70 | + --> tests/ui/needless_option_take.rs:43:13 |
| 71 | + | |
| 72 | +LL | let x = return_option().take(); |
| 73 | + | ^^^^^^^^^^^^^^^ |
| 74 | + |
| 75 | +error: called `Option::take()` on a temporary value |
| 76 | + --> tests/ui/needless_option_take.rs:47:13 |
| 77 | + | |
| 78 | +LL | let x = MyStruct::get_option().take(); |
| 79 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 80 | + | |
| 81 | +note: `get_option` creates a temporary value |
| 82 | + --> tests/ui/needless_option_take.rs:47:13 |
| 83 | + | |
| 84 | +LL | let x = MyStruct::get_option().take(); |
| 85 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 86 | + |
| 87 | +error: called `Option::take()` on a temporary value |
| 88 | + --> tests/ui/needless_option_take.rs:53:13 |
| 89 | + | |
| 90 | +LL | let y = my_vec.first().take(); |
| 91 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 92 | + | |
| 93 | +note: `first` creates a temporary value |
| 94 | + --> tests/ui/needless_option_take.rs:53:13 |
| 95 | + | |
| 96 | +LL | let y = my_vec.first().take(); |
| 97 | + | ^^^^^^^^^^^^^^ |
| 98 | + |
| 99 | +error: called `Option::take()` on a temporary value |
| 100 | + --> tests/ui/needless_option_take.rs:56:13 |
| 101 | + | |
| 102 | +LL | let y = my_vec.first().take(); |
| 103 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 104 | + | |
| 105 | +note: `first` creates a temporary value |
| 106 | + --> tests/ui/needless_option_take.rs:56:13 |
| 107 | + | |
| 108 | +LL | let y = my_vec.first().take(); |
| 109 | + | ^^^^^^^^^^^^^^ |
| 110 | + |
| 111 | +error: aborting due to 9 previous errors |
11 | 112 |
|
0 commit comments