2021-09-08 09:31:47 -05:00
|
|
|
error: manual implementation of `Option::map`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/manual_map_option_2.rs:6:13
|
2021-09-08 09:31:47 -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-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::manual_map)]`
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-09-08 09:31:47 -05:00
|
|
|
|
|
|
|
|
LL ~ let _ = Some(0).map(|x| {
|
|
|
|
LL + let y = (String::new(), String::new());
|
|
|
|
LL + (x, y.0)
|
|
|
|
LL ~ });
|
|
|
|
|
|
|
|
|
|
|
|
|
error: manual implementation of `Option::map`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/manual_map_option_2.rs:48:13
|
2021-09-08 09:31:47 -05:00
|
|
|
|
|
|
|
|
LL | let _ = match &s {
|
|
|
|
| _____________^
|
2023-11-02 11:12:25 -05:00
|
|
|
LL | | Some(x) => Some({ if let Some(ref s) = s { (x.clone(), s) } else { panic!() } }),
|
2021-09-08 09:31:47 -05:00
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-11-02 11:12:25 -05:00
|
|
|
| |_____^ help: try: `s.as_ref().map(|x| { if let Some(ref s) = s { (x.clone(), s) } else { panic!() } })`
|
2021-09-08 09:31:47 -05:00
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
error: manual implementation of `Option::map`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/manual_map_option_2.rs:58:17
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _________________^
|
|
|
|
LL | | Some(x) => Some(f(x)),
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_________^ help: try: `Some(0).map(|x| f(x))`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: manual implementation of `Option::map`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/manual_map_option_2.rs:63:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x) => unsafe { Some(f(x)) },
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `Some(0).map(|x| unsafe { f(x) })`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: manual implementation of `Option::map`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/manual_map_option_2.rs:67:13
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let _ = match Some(0) {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x) => Some(unsafe { f(x) }),
|
|
|
|
LL | | None => None,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `Some(0).map(|x| unsafe { f(x) })`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2021-09-08 09:31:47 -05:00
|
|
|
|