]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_split_once.stderr
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / manual_split_once.stderr
1 error: manual implementation of `split_once`
2   --> $DIR/manual_split_once.rs:14:13
3    |
4 LL |     let _ = "key=value".splitn(2, '=').nth(1).unwrap();
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
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, '=').skip(1).next().unwrap();
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
14
15 error: manual implementation of `split_once`
16   --> $DIR/manual_split_once.rs:16:18
17    |
18 LL |     let (_, _) = "key=value".splitn(2, '=').next_tuple().unwrap();
19    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=')`
20
21 error: manual implementation of `split_once`
22   --> $DIR/manual_split_once.rs:19:13
23    |
24 LL |     let _ = s.splitn(2, '=').nth(1).unwrap();
25    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').unwrap().1`
26
27 error: manual implementation of `split_once`
28   --> $DIR/manual_split_once.rs:22:13
29    |
30 LL |     let _ = s.splitn(2, '=').nth(1).unwrap();
31    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').unwrap().1`
32
33 error: manual implementation of `split_once`
34   --> $DIR/manual_split_once.rs:25:13
35    |
36 LL |     let _ = s.splitn(2, '=').skip(1).next().unwrap();
37    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').unwrap().1`
38
39 error: manual implementation of `split_once`
40   --> $DIR/manual_split_once.rs:28:17
41    |
42 LL |         let _ = s.splitn(2, '=').nth(1)?;
43    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=')?.1`
44
45 error: manual implementation of `split_once`
46   --> $DIR/manual_split_once.rs:29:17
47    |
48 LL |         let _ = s.splitn(2, '=').skip(1).next()?;
49    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=')?.1`
50
51 error: manual implementation of `rsplit_once`
52   --> $DIR/manual_split_once.rs:30:17
53    |
54 LL |         let _ = s.rsplitn(2, '=').nth(1)?;
55    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.rsplit_once('=')?.0`
56
57 error: manual implementation of `rsplit_once`
58   --> $DIR/manual_split_once.rs:31:17
59    |
60 LL |         let _ = s.rsplitn(2, '=').skip(1).next()?;
61    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.rsplit_once('=')?.0`
62
63 error: manual implementation of `rsplit_once`
64   --> $DIR/manual_split_once.rs:39:13
65    |
66 LL |     let _ = "key=value".rsplitn(2, '=').nth(1).unwrap();
67    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').unwrap().0`
68
69 error: manual implementation of `rsplit_once`
70   --> $DIR/manual_split_once.rs:40:18
71    |
72 LL |     let (_, _) = "key=value".rsplitn(2, '=').next_tuple().unwrap();
73    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".rsplit_once('=').map(|(x, y)| (y, x))`
74
75 error: manual implementation of `rsplit_once`
76   --> $DIR/manual_split_once.rs:41:13
77    |
78 LL |     let _ = s.rsplitn(2, '=').nth(1);
79    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.rsplit_once('=').map(|x| x.0)`
80
81 error: manual implementation of `split_once`
82   --> $DIR/manual_split_once.rs:45:5
83    |
84 LL |     let mut iter = "a.b.c".splitn(2, '.');
85    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86 LL |     let l = iter.next().unwrap();
87    |     ----------------------------- first usage here
88 LL |     let r = iter.next().unwrap();
89    |     ----------------------------- second usage here
90    |
91 help: try `split_once`
92    |
93 LL |     let (l, r) = "a.b.c".split_once('.').unwrap();
94    |
95 help: remove the `iter` usages
96    |
97 LL -     let l = iter.next().unwrap();
98 LL +     
99    |
100 help: remove the `iter` usages
101    |
102 LL -     let r = iter.next().unwrap();
103 LL +     
104    |
105
106 error: manual implementation of `split_once`
107   --> $DIR/manual_split_once.rs:49:5
108    |
109 LL |     let mut iter = "a.b.c".splitn(2, '.');
110    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111 LL |     let l = iter.next()?;
112    |     --------------------- first usage here
113 LL |     let r = iter.next()?;
114    |     --------------------- second usage here
115    |
116 help: try `split_once`
117    |
118 LL |     let (l, r) = "a.b.c".split_once('.')?;
119    |
120 help: remove the `iter` usages
121    |
122 LL -     let l = iter.next()?;
123 LL +     
124    |
125 help: remove the `iter` usages
126    |
127 LL -     let r = iter.next()?;
128 LL +     
129    |
130
131 error: manual implementation of `rsplit_once`
132   --> $DIR/manual_split_once.rs:53:5
133    |
134 LL |     let mut iter = "a.b.c".rsplitn(2, '.');
135    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136 LL |     let r = iter.next().unwrap();
137    |     ----------------------------- first usage here
138 LL |     let l = iter.next().unwrap();
139    |     ----------------------------- second usage here
140    |
141 help: try `rsplit_once`
142    |
143 LL |     let (l, r) = "a.b.c".rsplit_once('.').unwrap();
144    |
145 help: remove the `iter` usages
146    |
147 LL -     let r = iter.next().unwrap();
148 LL +     
149    |
150 help: remove the `iter` usages
151    |
152 LL -     let l = iter.next().unwrap();
153 LL +     
154    |
155
156 error: manual implementation of `rsplit_once`
157   --> $DIR/manual_split_once.rs:57:5
158    |
159 LL |     let mut iter = "a.b.c".rsplitn(2, '.');
160    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161 LL |     let r = iter.next()?;
162    |     --------------------- first usage here
163 LL |     let l = iter.next()?;
164    |     --------------------- second usage here
165    |
166 help: try `rsplit_once`
167    |
168 LL |     let (l, r) = "a.b.c".rsplit_once('.')?;
169    |
170 help: remove the `iter` usages
171    |
172 LL -     let r = iter.next()?;
173 LL +     
174    |
175 help: remove the `iter` usages
176    |
177 LL -     let l = iter.next()?;
178 LL +     
179    |
180
181 error: manual implementation of `split_once`
182   --> $DIR/manual_split_once.rs:142:13
183    |
184 LL |     let _ = "key=value".splitn(2, '=').nth(1).unwrap();
185    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
186
187 error: manual implementation of `split_once`
188   --> $DIR/manual_split_once.rs:144:5
189    |
190 LL |     let mut iter = "a.b.c".splitn(2, '.');
191    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192 LL |     let a = iter.next().unwrap();
193    |     ----------------------------- first usage here
194 LL |     let b = iter.next().unwrap();
195    |     ----------------------------- second usage here
196    |
197 help: try `split_once`
198    |
199 LL |     let (a, b) = "a.b.c".split_once('.').unwrap();
200    |
201 help: remove the `iter` usages
202    |
203 LL -     let a = iter.next().unwrap();
204 LL +     
205    |
206 help: remove the `iter` usages
207    |
208 LL -     let b = iter.next().unwrap();
209 LL +     
210    |
211
212 error: aborting due to 19 previous errors
213