1
1
error: manual implementation of `Option::map`
2
- --> $DIR/manual_map_option.rs:13 :5
2
+ --> $DIR/manual_map_option.rs:14 :5
3
3
|
4
4
LL | / match Some(0) {
5
5
LL | | Some(_) => Some(2),
@@ -10,7 +10,7 @@ LL | | };
10
10
= note: `-D clippy::manual-map` implied by `-D warnings`
11
11
12
12
error: manual implementation of `Option::map`
13
- --> $DIR/manual_map_option.rs:18 :5
13
+ --> $DIR/manual_map_option.rs:19 :5
14
14
|
15
15
LL | / match Some(0) {
16
16
LL | | Some(x) => Some(x + 1),
@@ -19,7 +19,7 @@ LL | | };
19
19
| |_____^ help: try this: `Some(0).map(|x| x + 1)`
20
20
21
21
error: manual implementation of `Option::map`
22
- --> $DIR/manual_map_option.rs:23 :5
22
+ --> $DIR/manual_map_option.rs:24 :5
23
23
|
24
24
LL | / match Some("") {
25
25
LL | | Some(x) => Some(x.is_empty()),
@@ -28,7 +28,7 @@ LL | | };
28
28
| |_____^ help: try this: `Some("").map(|x| x.is_empty())`
29
29
30
30
error: manual implementation of `Option::map`
31
- --> $DIR/manual_map_option.rs:28 :5
31
+ --> $DIR/manual_map_option.rs:29 :5
32
32
|
33
33
LL | / if let Some(x) = Some(0) {
34
34
LL | | Some(!x)
@@ -38,7 +38,7 @@ LL | | };
38
38
| |_____^ help: try this: `Some(0).map(|x| !x)`
39
39
40
40
error: manual implementation of `Option::map`
41
- --> $DIR/manual_map_option.rs:35 :5
41
+ --> $DIR/manual_map_option.rs:36 :5
42
42
|
43
43
LL | / match Some(0) {
44
44
LL | | Some(x) => { Some(std::convert::identity(x)) }
@@ -47,7 +47,7 @@ LL | | };
47
47
| |_____^ help: try this: `Some(0).map(std::convert::identity)`
48
48
49
49
error: manual implementation of `Option::map`
50
- --> $DIR/manual_map_option.rs:40 :5
50
+ --> $DIR/manual_map_option.rs:41 :5
51
51
|
52
52
LL | / match Some(&String::new()) {
53
53
LL | | Some(x) => Some(str::len(x)),
@@ -56,7 +56,7 @@ LL | | };
56
56
| |_____^ help: try this: `Some(&String::new()).map(|x| str::len(x))`
57
57
58
58
error: manual implementation of `Option::map`
59
- --> $DIR/manual_map_option.rs:50 :5
59
+ --> $DIR/manual_map_option.rs:51 :5
60
60
|
61
61
LL | / match &Some([0, 1]) {
62
62
LL | | Some(x) => Some(x[0]),
@@ -65,7 +65,7 @@ LL | | };
65
65
| |_____^ help: try this: `Some([0, 1]).as_ref().map(|x| x[0])`
66
66
67
67
error: manual implementation of `Option::map`
68
- --> $DIR/manual_map_option.rs:55 :5
68
+ --> $DIR/manual_map_option.rs:56 :5
69
69
|
70
70
LL | / match &Some(0) {
71
71
LL | | &Some(x) => Some(x * 2),
@@ -74,7 +74,7 @@ LL | | };
74
74
| |_____^ help: try this: `Some(0).map(|x| x * 2)`
75
75
76
76
error: manual implementation of `Option::map`
77
- --> $DIR/manual_map_option.rs:60 :5
77
+ --> $DIR/manual_map_option.rs:61 :5
78
78
|
79
79
LL | / match Some(String::new()) {
80
80
LL | | Some(ref x) => Some(x.is_empty()),
@@ -83,7 +83,7 @@ LL | | };
83
83
| |_____^ help: try this: `Some(String::new()).as_ref().map(|x| x.is_empty())`
84
84
85
85
error: manual implementation of `Option::map`
86
- --> $DIR/manual_map_option.rs:65 :5
86
+ --> $DIR/manual_map_option.rs:66 :5
87
87
|
88
88
LL | / match &&Some(String::new()) {
89
89
LL | | Some(x) => Some(x.len()),
@@ -92,7 +92,7 @@ LL | | };
92
92
| |_____^ help: try this: `Some(String::new()).as_ref().map(|x| x.len())`
93
93
94
94
error: manual implementation of `Option::map`
95
- --> $DIR/manual_map_option.rs:70 :5
95
+ --> $DIR/manual_map_option.rs:71 :5
96
96
|
97
97
LL | / match &&Some(0) {
98
98
LL | | &&Some(x) => Some(x + x),
@@ -101,7 +101,7 @@ LL | | };
101
101
| |_____^ help: try this: `Some(0).map(|x| x + x)`
102
102
103
103
error: manual implementation of `Option::map`
104
- --> $DIR/manual_map_option.rs:83 :9
104
+ --> $DIR/manual_map_option.rs:84 :9
105
105
|
106
106
LL | / match &mut Some(String::new()) {
107
107
LL | | Some(x) => Some(x.push_str("")),
@@ -110,7 +110,7 @@ LL | | };
110
110
| |_________^ help: try this: `Some(String::new()).as_mut().map(|x| x.push_str(""))`
111
111
112
112
error: manual implementation of `Option::map`
113
- --> $DIR/manual_map_option.rs:89 :5
113
+ --> $DIR/manual_map_option.rs:90 :5
114
114
|
115
115
LL | / match &mut Some(String::new()) {
116
116
LL | | Some(ref x) => Some(x.len()),
@@ -119,7 +119,7 @@ LL | | };
119
119
| |_____^ help: try this: `Some(String::new()).as_ref().map(|x| x.len())`
120
120
121
121
error: manual implementation of `Option::map`
122
- --> $DIR/manual_map_option.rs:94 :5
122
+ --> $DIR/manual_map_option.rs:95 :5
123
123
|
124
124
LL | / match &mut &Some(String::new()) {
125
125
LL | | Some(x) => Some(x.is_empty()),
@@ -128,7 +128,7 @@ LL | | };
128
128
| |_____^ help: try this: `Some(String::new()).as_ref().map(|x| x.is_empty())`
129
129
130
130
error: manual implementation of `Option::map`
131
- --> $DIR/manual_map_option.rs:99 :5
131
+ --> $DIR/manual_map_option.rs:100 :5
132
132
|
133
133
LL | / match Some((0, 1, 2)) {
134
134
LL | | Some((x, y, z)) => Some(x + y + z),
@@ -137,7 +137,7 @@ LL | | };
137
137
| |_____^ help: try this: `Some((0, 1, 2)).map(|(x, y, z)| x + y + z)`
138
138
139
139
error: manual implementation of `Option::map`
140
- --> $DIR/manual_map_option.rs:104 :5
140
+ --> $DIR/manual_map_option.rs:105 :5
141
141
|
142
142
LL | / match Some([1, 2, 3]) {
143
143
LL | | Some([first, ..]) => Some(first),
@@ -146,7 +146,7 @@ LL | | };
146
146
| |_____^ help: try this: `Some([1, 2, 3]).map(|[first, ..]| first)`
147
147
148
148
error: manual implementation of `Option::map`
149
- --> $DIR/manual_map_option.rs:109 :5
149
+ --> $DIR/manual_map_option.rs:110 :5
150
150
|
151
151
LL | / match &Some((String::new(), "test")) {
152
152
LL | | Some((x, y)) => Some((y, x)),
@@ -155,7 +155,7 @@ LL | | };
155
155
| |_____^ help: try this: `Some((String::new(), "test")).as_ref().map(|(x, y)| (y, x))`
156
156
157
157
error: manual implementation of `Option::map`
158
- --> $DIR/manual_map_option.rs:167 :5
158
+ --> $DIR/manual_map_option.rs:168 :5
159
159
|
160
160
LL | / match Some(0) {
161
161
LL | | Some(x) => Some(vec![x]),
@@ -164,7 +164,7 @@ LL | | };
164
164
| |_____^ help: try this: `Some(0).map(|x| vec![x])`
165
165
166
166
error: manual implementation of `Option::map`
167
- --> $DIR/manual_map_option.rs:172 :5
167
+ --> $DIR/manual_map_option.rs:173 :5
168
168
|
169
169
LL | / match option_env!("") {
170
170
LL | | Some(x) => Some(String::from(x)),
0 commit comments