fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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