summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_split_once.stderr
blob: af9c7a2d41bff248f287da4e9f022b06a886b02a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:13:13
   |
LL |     let _ = "key=value".splitn(2, '=').next();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Some("key=value".split_once('=').map_or("key=value", |x| x.0))`
   |
   = note: `-D clippy::manual-split-once` implied by `-D warnings`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:15:13
   |
LL |     let _ = "key=value".splitn(2, '=').next().unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').map_or("key=value", |x| x.0)`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:16:13
   |
LL |     let _ = "key=value".splitn(2, '=').nth(0).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').map_or("key=value", |x| x.0)`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:17:13
   |
LL |     let _ = "key=value".splitn(2, '=').nth(1).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:18:13
   |
LL |     let _ = "key=value".splitn(2, '=').skip(1).next().unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:19:18
   |
LL |     let (_, _) = "key=value".splitn(2, '=').next_tuple().unwrap();
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=')`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:22:13
   |
LL |     let _ = s.splitn(2, '=').next().unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').map_or(&*s, |x| x.0)`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:25:13
   |
LL |     let _ = s.splitn(2, '=').nth(0).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').map_or(&*s, |x| x.0)`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:28:13
   |
LL |     let _ = s.splitn(2, '=').skip(0).next().unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').map_or(*s, |x| x.0)`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:31:17
   |
LL |         let _ = s.splitn(2, "key=value").next()?;
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once("key=value").map_or(s, |x| x.0)`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:32:17
   |
LL |         let _ = s.splitn(2, "key=value").nth(1)?;
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once("key=value")?.1`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:33:17
   |
LL |         let _ = s.splitn(2, "key=value").skip(1).next()?;
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once("key=value")?.1`

error: manual implementation of `rsplit_once`
  --> $DIR/manual_split_once.rs:42:13
   |
LL |     let _ = "key=value".rsplitn(2, '=').nth(1).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').unwrap().0`

error: manual implementation of `rsplit_once`
  --> $DIR/manual_split_once.rs:43:13
   |
LL |     let _ = "key=value".rsplitn(2, '=').nth(0);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').map(|x| x.1)`

error: manual implementation of `rsplit_once`
  --> $DIR/manual_split_once.rs:44:18
   |
LL |     let (_, _) = "key=value".rsplitn(2, '=').next_tuple().unwrap();
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').map(|(x, y)| (y, x))`

error: manual implementation of `split_once`
  --> $DIR/manual_split_once.rs:55:13
   |
LL |     let _ = "key=value".splitn(2, '=').nth(1).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`

error: aborting due to 16 previous errors