2021-08-01 17:39:56 -05:00
|
|
|
error: manual implementation of `Option::map`
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/manual_map_option_2.rs:6:13
|
2021-08-01 17:39:56 -05:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x) => Some({
|
|
|
|
LL | | let y = (String::new(), String::new());
|
|
|
|
LL | | (x, y.0)
|
|
|
|
LL | | }),
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::manual-map` implied by `-D warnings`
|
2023-07-01 06:08:01 -05:00
|
|
|
help: try
|
2021-08-01 17:39:56 -05:00
|
|
|
|
|
2021-08-14 18:52:59 -05:00
|
|
|
LL ~ let _ = Some(0).map(|x| {
|
|
|
|
LL + let y = (String::new(), String::new());
|
|
|
|
LL + (x, y.0)
|
|
|
|
LL ~ });
|
2021-08-01 17:39:56 -05:00
|
|
|
|
|
|
|
|
|
2021-08-09 13:18:53 -05:00
|
|
|
error: manual implementation of `Option::map`
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/manual_map_option_2.rs:48:13
|
2021-08-09 13:18:53 -05:00
|
|
|
|
|
|
|
|
LL | let _ = match &s {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x) => Some({
|
|
|
|
LL | | if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
|
|
|
|
LL | | }),
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
2023-07-01 06:08:01 -05:00
|
|
|
help: try
|
2021-08-09 13:18:53 -05:00
|
|
|
|
|
2021-08-14 18:52:59 -05:00
|
|
|
LL ~ let _ = s.as_ref().map(|x| {
|
|
|
|
LL + if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
|
|
|
|
LL ~ });
|
2021-08-09 13:18:53 -05:00
|
|
|
|
|
|
|
|
|
2021-11-12 18:12:17 -06:00
|
|
|
error: manual implementation of `Option::map`
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/manual_map_option_2.rs:60:17
|
2021-11-12 18:12:17 -06:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _________________^
|
|
|
|
LL | | Some(x) => Some(f(x)),
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-07-01 06:08:01 -05:00
|
|
|
| |_________^ help: try: `Some(0).map(|x| f(x))`
|
2021-11-12 18:12:17 -06:00
|
|
|
|
|
|
|
error: manual implementation of `Option::map`
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/manual_map_option_2.rs:65:13
|
2021-11-12 18:12:17 -06:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x) => unsafe { Some(f(x)) },
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-07-01 06:08:01 -05:00
|
|
|
| |_____^ help: try: `Some(0).map(|x| unsafe { f(x) })`
|
2021-11-12 18:12:17 -06:00
|
|
|
|
2021-11-17 09:39:53 -06:00
|
|
|
error: manual implementation of `Option::map`
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/manual_map_option_2.rs:69:13
|
2021-11-17 09:39:53 -06:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x) => Some(unsafe { f(x) }),
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-07-01 06:08:01 -05:00
|
|
|
| |_____^ help: try: `Some(0).map(|x| unsafe { f(x) })`
|
2021-11-17 09:39:53 -06:00
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2021-08-01 17:39:56 -05:00
|
|
|
|