]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_split_once.stderr
Don't lint `if_same_then_else` with `if let` conditions
[rust.git] / tests / ui / manual_split_once.stderr
1 error: manual implementation of `split_once`
2   --> $DIR/manual_split_once.rs:13:13
3    |
4 LL |     let _ = "key=value".splitn(2, '=').next();
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Some("key=value".split_once('=').map_or("key=value", |x| x.0))`
6    |
7    = note: `-D clippy::manual-split-once` implied by `-D warnings`
8
9 error: manual implementation of `split_once`
10   --> $DIR/manual_split_once.rs:15:13
11    |
12 LL |     let _ = "key=value".splitn(2, '=').next().unwrap();
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').map_or("key=value", |x| x.0)`
14
15 error: manual implementation of `split_once`
16   --> $DIR/manual_split_once.rs:16:13
17    |
18 LL |     let _ = "key=value".splitn(2, '=').nth(0).unwrap();
19    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').map_or("key=value", |x| x.0)`
20
21 error: manual implementation of `split_once`
22   --> $DIR/manual_split_once.rs:17:13
23    |
24 LL |     let _ = "key=value".splitn(2, '=').nth(1).unwrap();
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
26
27 error: manual implementation of `split_once`
28   --> $DIR/manual_split_once.rs:18:13
29    |
30 LL |     let _ = "key=value".splitn(2, '=').skip(1).next().unwrap();
31    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
32
33 error: manual implementation of `split_once`
34   --> $DIR/manual_split_once.rs:19:18
35    |
36 LL |     let (_, _) = "key=value".splitn(2, '=').next_tuple().unwrap();
37    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=')`
38
39 error: manual implementation of `split_once`
40   --> $DIR/manual_split_once.rs:22:13
41    |
42 LL |     let _ = s.splitn(2, '=').next().unwrap();
43    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').map_or(&*s, |x| x.0)`
44
45 error: manual implementation of `split_once`
46   --> $DIR/manual_split_once.rs:25:13
47    |
48 LL |     let _ = s.splitn(2, '=').nth(0).unwrap();
49    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').map_or(&*s, |x| x.0)`
50
51 error: manual implementation of `split_once`
52   --> $DIR/manual_split_once.rs:28:13
53    |
54 LL |     let _ = s.splitn(2, '=').skip(0).next().unwrap();
55    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').map_or(*s, |x| x.0)`
56
57 error: manual implementation of `split_once`
58   --> $DIR/manual_split_once.rs:31:17
59    |
60 LL |         let _ = s.splitn(2, "key=value").next()?;
61    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once("key=value").map_or(s, |x| x.0)`
62
63 error: manual implementation of `split_once`
64   --> $DIR/manual_split_once.rs:32:17
65    |
66 LL |         let _ = s.splitn(2, "key=value").nth(1)?;
67    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once("key=value")?.1`
68
69 error: manual implementation of `split_once`
70   --> $DIR/manual_split_once.rs:33:17
71    |
72 LL |         let _ = s.splitn(2, "key=value").skip(1).next()?;
73    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once("key=value")?.1`
74
75 error: manual implementation of `rsplit_once`
76   --> $DIR/manual_split_once.rs:42:13
77    |
78 LL |     let _ = "key=value".rsplitn(2, '=').nth(1).unwrap();
79    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').unwrap().0`
80
81 error: manual implementation of `rsplit_once`
82   --> $DIR/manual_split_once.rs:43:13
83    |
84 LL |     let _ = "key=value".rsplitn(2, '=').nth(0);
85    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').map(|x| x.1)`
86
87 error: manual implementation of `rsplit_once`
88   --> $DIR/manual_split_once.rs:44:18
89    |
90 LL |     let (_, _) = "key=value".rsplitn(2, '=').next_tuple().unwrap();
91    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').map(|(x, y)| (y, x))`
92
93 error: manual implementation of `split_once`
94   --> $DIR/manual_split_once.rs:55:13
95    |
96 LL |     let _ = "key=value".splitn(2, '=').nth(1).unwrap();
97    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
98
99 error: aborting due to 16 previous errors
100