rust/tests/ui/manual_split_once.stderr

89 lines
3.6 KiB
Plaintext
Raw Normal View History

2021-07-17 12:52:03 -05:00
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:14:13
2021-07-17 12:52:03 -05:00
|
LL | let _ = "key=value".splitn(2, '=').nth(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
2021-07-17 12:52:03 -05:00
|
= 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, '=').skip(1).next().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:16:18
2021-07-17 12:52:03 -05:00
|
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:19:13
|
LL | let _ = s.splitn(2, '=').nth(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').unwrap().1`
2021-07-17 12:52:03 -05:00
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:22:13
|
LL | let _ = s.splitn(2, '=').nth(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').unwrap().1`
2021-07-17 12:52:03 -05:00
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:25:13
|
LL | let _ = s.splitn(2, '=').skip(1).next().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=').unwrap().1`
2021-07-17 12:52:03 -05:00
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:28:17
2021-07-17 12:52:03 -05:00
|
LL | let _ = s.splitn(2, '=').nth(1)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=')?.1`
2021-07-17 12:52:03 -05:00
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:29:17
2021-07-17 12:52:03 -05:00
|
LL | let _ = s.splitn(2, '=').skip(1).next()?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.split_once('=')?.1`
2021-07-17 12:52:03 -05:00
error: manual implementation of `rsplit_once`
--> $DIR/manual_split_once.rs:30:17
2021-07-17 12:52:03 -05:00
|
LL | let _ = s.rsplitn(2, '=').nth(1)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.rsplit_once('=')?.0`
2021-07-17 12:52:03 -05:00
error: manual implementation of `rsplit_once`
--> $DIR/manual_split_once.rs:31:17
2021-07-17 12:52:03 -05:00
|
LL | let _ = s.rsplitn(2, '=').skip(1).next()?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.rsplit_once('=')?.0`
2021-07-17 12:52:03 -05:00
error: manual implementation of `rsplit_once`
--> $DIR/manual_split_once.rs:39: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:40: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 `rsplit_once`
--> $DIR/manual_split_once.rs:41:13
|
LL | let _ = s.rsplitn(2, '=').nth(1);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `s.rsplit_once('=').map(|x| x.0)`
2021-07-17 12:52:03 -05:00
error: manual implementation of `split_once`
--> $DIR/manual_split_once.rs:52:13
2021-07-17 12:52:03 -05:00
|
LL | let _ = "key=value".splitn(2, '=').nth(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `"key=value".split_once('=').unwrap().1`
error: aborting due to 14 previous errors
2021-07-17 12:52:03 -05:00