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