@@ -2,7 +2,9 @@ error: called `Option::take()` on a temporary value
2
2
--> tests/ui/needless_option_take.rs:23:5
3
3
|
4
4
LL | x.as_ref().take();
5
- | ^^^^^^^^^^^^^^^^^
5
+ | ^^^^^^^^^^-------
6
+ | |
7
+ | help: remove
6
8
|
7
9
= note: `as_ref` creates a temporary value, so calling take() has no effect
8
10
= note: `-D clippy::needless-option-take` implied by `-D warnings`
@@ -12,63 +14,79 @@ error: called `Option::take()` on a temporary value
12
14
--> tests/ui/needless_option_take.rs:31:13
13
15
|
14
16
LL | let y = x.as_mut().take();
15
- | ^^^^^^^^^^^^^^^^^
17
+ | ^^^^^^^^^^-------
18
+ | |
19
+ | help: remove
16
20
|
17
21
= note: `as_mut` creates a temporary value, so calling take() has no effect
18
22
19
23
error: called `Option::take()` on a temporary value
20
24
--> tests/ui/needless_option_take.rs:33:13
21
25
|
22
26
LL | let y = x.replace(289).take();
23
- | ^^^^^^^^^^^^^^^^^^^^^
27
+ | ^^^^^^^^^^^^^^-------
28
+ | |
29
+ | help: remove
24
30
|
25
31
= note: `replace` creates a temporary value, so calling take() has no effect
26
32
27
33
error: called `Option::take()` on a temporary value
28
34
--> tests/ui/needless_option_take.rs:36:13
29
35
|
30
36
LL | let y = Some(3).as_mut().take();
31
- | ^^^^^^^^^^^^^^^^^^^^^^^
37
+ | ^^^^^^^^^^^^^^^^-------
38
+ | |
39
+ | help: remove
32
40
|
33
41
= note: `as_mut` creates a temporary value, so calling take() has no effect
34
42
35
43
error: called `Option::take()` on a temporary value
36
44
--> tests/ui/needless_option_take.rs:39:13
37
45
|
38
46
LL | let y = Option::as_mut(&mut x).take();
39
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
+ | ^^^^^^^^^^^^^^^^^^^^^^-------
48
+ | |
49
+ | help: remove
40
50
|
41
51
= note: `as_mut` creates a temporary value, so calling take() has no effect
42
52
43
53
error: called `Option::take()` on a temporary value
44
54
--> tests/ui/needless_option_take.rs:43:13
45
55
|
46
56
LL | let x = return_option().take();
47
- | ^^^^^^^^^^^^^^^^^^^^^^
57
+ | ^^^^^^^^^^^^^^^-------
58
+ | |
59
+ | help: remove
48
60
|
49
61
= note: `return_option` creates a temporary value, so calling take() has no effect
50
62
51
63
error: called `Option::take()` on a temporary value
52
64
--> tests/ui/needless_option_take.rs:47:13
53
65
|
54
66
LL | let x = MyStruct::get_option().take();
55
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67
+ | ^^^^^^^^^^^^^^^^^^^^^^-------
68
+ | |
69
+ | help: remove
56
70
|
57
71
= note: `get_option` creates a temporary value, so calling take() has no effect
58
72
59
73
error: called `Option::take()` on a temporary value
60
74
--> tests/ui/needless_option_take.rs:53:13
61
75
|
62
76
LL | let y = my_vec.first().take();
63
- | ^^^^^^^^^^^^^^^^^^^^^
77
+ | ^^^^^^^^^^^^^^-------
78
+ | |
79
+ | help: remove
64
80
|
65
81
= note: `first` creates a temporary value, so calling take() has no effect
66
82
67
83
error: called `Option::take()` on a temporary value
68
84
--> tests/ui/needless_option_take.rs:56:13
69
85
|
70
86
LL | let y = my_vec.first().take();
71
- | ^^^^^^^^^^^^^^^^^^^^^
87
+ | ^^^^^^^^^^^^^^-------
88
+ | |
89
+ | help: remove
72
90
|
73
91
= note: `first` creates a temporary value, so calling take() has no effect
74
92
0 commit comments