Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3999b30

Browse files
committed
Update stderrs
1 parent 2dc73c4 commit 3999b30

File tree

7 files changed

+69
-26
lines changed

7 files changed

+69
-26
lines changed

tests/ui/expect.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
error: used `expect()` on `an Option` value. If this value is an `None` it will panic
1+
error: used `expect()` on `an Option` value
22
--> $DIR/expect.rs:5:13
33
|
44
LL | let _ = opt.expect("");
55
| ^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::option-expect-used` implied by `-D warnings`
8+
= help: If this value is an `None`, it will panic.
89

9-
error: used `expect()` on `a Result` value. If this value is an `Err` it will panic
10+
error: used `expect()` on `a Result` value
1011
--> $DIR/expect.rs:10:13
1112
|
1213
LL | let _ = res.expect("");
1314
| ^^^^^^^^^^^^^^
1415
|
1516
= note: `-D clippy::result-expect-used` implied by `-D warnings`
17+
= help: If this value is an `Err`, it will panic.
1618

1719
error: aborting due to 2 previous errors
1820

tests/ui/filter_methods.stderr

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.filter_map(..)` instead.
1+
error: called `filter(p).map(q)` on an `Iterator`
22
--> $DIR/filter_methods.rs:5:21
33
|
44
LL | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::filter-map` implied by `-D warnings`
8+
= help: This is more succinctly expressed by calling `.filter_map(..)` instead.
89

9-
error: called `filter(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
10+
error: called `filter(p).flat_map(q)` on an `Iterator`
1011
--> $DIR/filter_methods.rs:7:21
1112
|
1213
LL | let _: Vec<_> = vec![5_i8; 6]
@@ -15,8 +16,10 @@ LL | | .into_iter()
1516
LL | | .filter(|&x| x == 0)
1617
LL | | .flat_map(|x| x.checked_mul(2))
1718
| |_______________________________________^
19+
|
20+
= help: This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
1821

19-
error: called `filter_map(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
22+
error: called `filter_map(p).flat_map(q)` on an `Iterator`
2023
--> $DIR/filter_methods.rs:13:21
2124
|
2225
LL | let _: Vec<_> = vec![5_i8; 6]
@@ -25,8 +28,10 @@ LL | | .into_iter()
2528
LL | | .filter_map(|x| x.checked_mul(2))
2629
LL | | .flat_map(|x| x.checked_mul(2))
2730
| |_______________________________________^
31+
|
32+
= help: This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
2833

29-
error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
34+
error: called `filter_map(p).map(q)` on an `Iterator`
3035
--> $DIR/filter_methods.rs:19:21
3136
|
3237
LL | let _: Vec<_> = vec![5_i8; 6]
@@ -35,6 +40,8 @@ LL | | .into_iter()
3540
LL | | .filter_map(|x| x.checked_mul(2))
3641
LL | | .map(|x| x.checked_mul(2))
3742
| |__________________________________^
43+
|
44+
= help: This is more succinctly expressed by only calling `.filter_map(..)` instead.
3845

3946
error: aborting due to 4 previous errors
4047

tests/ui/find_map.stderr

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
error: called `find(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead.
1+
error: called `find(p).map(q)` on an `Iterator`
22
--> $DIR/find_map.rs:20:26
33
|
44
LL | let _: Option<i32> = a.iter().find(|s| s.parse::<i32>().is_ok()).map(|s| s.parse().unwrap());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::find-map` implied by `-D warnings`
8+
= help: This is more succinctly expressed by calling `.find_map(..)` instead.
89

9-
error: called `find(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead.
10+
error: called `find(p).map(q)` on an `Iterator`
1011
--> $DIR/find_map.rs:22:29
1112
|
1213
LL | let _: Option<Flavor> = desserts_of_the_week
@@ -18,6 +19,8 @@ LL | | Dessert::Cake(_) => true,
1819
LL | | _ => unreachable!(),
1920
LL | | });
2021
| |__________^
22+
|
23+
= help: This is more succinctly expressed by calling `.find_map(..)` instead.
2124

2225
error: aborting due to 2 previous errors
2326

tests/ui/iter_nth.stderr

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,59 @@
1-
error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
1+
error: called `.iter().nth()` on a Vec
22
--> $DIR/iter_nth.rs:33:23
33
|
44
LL | let bad_vec = some_vec.iter().nth(3);
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::iter-nth` implied by `-D warnings`
8+
= help: Calling `.get()` is both faster and more readable
89

9-
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
10+
error: called `.iter().nth()` on a slice
1011
--> $DIR/iter_nth.rs:34:26
1112
|
1213
LL | let bad_slice = &some_vec[..].iter().nth(3);
1314
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
|
16+
= help: Calling `.get()` is both faster and more readable
1417

15-
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
18+
error: called `.iter().nth()` on a slice
1619
--> $DIR/iter_nth.rs:35:31
1720
|
1821
LL | let bad_boxed_slice = boxed_slice.iter().nth(3);
1922
| ^^^^^^^^^^^^^^^^^^^^^^^^^
23+
|
24+
= help: Calling `.get()` is both faster and more readable
2025

21-
error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
26+
error: called `.iter().nth()` on a VecDeque
2227
--> $DIR/iter_nth.rs:36:29
2328
|
2429
LL | let bad_vec_deque = some_vec_deque.iter().nth(3);
2530
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
|
32+
= help: Calling `.get()` is both faster and more readable
2633

27-
error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
34+
error: called `.iter_mut().nth()` on a Vec
2835
--> $DIR/iter_nth.rs:41:23
2936
|
3037
LL | let bad_vec = some_vec.iter_mut().nth(3);
3138
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
39+
|
40+
= help: Calling `.get_mut()` is both faster and more readable
3241

33-
error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
42+
error: called `.iter_mut().nth()` on a slice
3443
--> $DIR/iter_nth.rs:44:26
3544
|
3645
LL | let bad_slice = &some_vec[..].iter_mut().nth(3);
3746
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47+
|
48+
= help: Calling `.get_mut()` is both faster and more readable
3849

39-
error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
50+
error: called `.iter_mut().nth()` on a VecDeque
4051
--> $DIR/iter_nth.rs:47:29
4152
|
4253
LL | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
4354
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
|
56+
= help: Calling `.get_mut()` is both faster and more readable
4457

4558
error: aborting due to 7 previous errors
4659

tests/ui/iter_skip_next.stderr

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
1+
error: called `skip(x).next()` on an iterator
22
--> $DIR/iter_skip_next.rs:13:13
33
|
44
LL | let _ = some_vec.iter().skip(42).next();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::iter-skip-next` implied by `-D warnings`
8+
= help: This is more succinctly expressed by calling `nth(x)`.
89

9-
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
10+
error: called `skip(x).next()` on an iterator
1011
--> $DIR/iter_skip_next.rs:14:13
1112
|
1213
LL | let _ = some_vec.iter().cycle().skip(42).next();
1314
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
|
16+
= help: This is more succinctly expressed by calling `nth(x)`.
1417

15-
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
18+
error: called `skip(x).next()` on an iterator
1619
--> $DIR/iter_skip_next.rs:15:13
1720
|
1821
LL | let _ = (1..10).skip(10).next();
1922
| ^^^^^^^^^^^^^^^^^^^^^^^
23+
|
24+
= help: This is more succinctly expressed by calling `nth(x)`.
2025

21-
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
26+
error: called `skip(x).next()` on an iterator
2227
--> $DIR/iter_skip_next.rs:16:14
2328
|
2429
LL | let _ = &some_vec[..].iter().skip(3).next();
2530
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
|
32+
= help: This is more succinctly expressed by calling `nth(x)`.
2633

2734
error: aborting due to 4 previous errors
2835

tests/ui/ok_expect.stderr

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
1-
error: called `ok().expect()` on a `Result` value. You can call `expect()` directly on the `Result`
1+
error: called `ok().expect()` on a `Result` value
22
--> $DIR/ok_expect.rs:14:5
33
|
44
LL | res.ok().expect("disaster!");
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::ok-expect` implied by `-D warnings`
8+
= help: You can call `expect()` directly on the `Result`
89

9-
error: called `ok().expect()` on a `Result` value. You can call `expect()` directly on the `Result`
10+
error: called `ok().expect()` on a `Result` value
1011
--> $DIR/ok_expect.rs:20:5
1112
|
1213
LL | res3.ok().expect("whoof");
1314
| ^^^^^^^^^^^^^^^^^^^^^^^^^
15+
|
16+
= help: You can call `expect()` directly on the `Result`
1417

15-
error: called `ok().expect()` on a `Result` value. You can call `expect()` directly on the `Result`
18+
error: called `ok().expect()` on a `Result` value
1619
--> $DIR/ok_expect.rs:22:5
1720
|
1821
LL | res4.ok().expect("argh");
1922
| ^^^^^^^^^^^^^^^^^^^^^^^^
23+
|
24+
= help: You can call `expect()` directly on the `Result`
2025

21-
error: called `ok().expect()` on a `Result` value. You can call `expect()` directly on the `Result`
26+
error: called `ok().expect()` on a `Result` value
2227
--> $DIR/ok_expect.rs:24:5
2328
|
2429
LL | res5.ok().expect("oops");
2530
| ^^^^^^^^^^^^^^^^^^^^^^^^
31+
|
32+
= help: You can call `expect()` directly on the `Result`
2633

27-
error: called `ok().expect()` on a `Result` value. You can call `expect()` directly on the `Result`
34+
error: called `ok().expect()` on a `Result` value
2835
--> $DIR/ok_expect.rs:26:5
2936
|
3037
LL | res6.ok().expect("meh");
3138
| ^^^^^^^^^^^^^^^^^^^^^^^
39+
|
40+
= help: You can call `expect()` directly on the `Result`
3241

3342
error: aborting due to 5 previous errors
3443

tests/ui/unwrap.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
error: used `unwrap()` on `an Option` value. If you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
1+
error: used `unwrap()` on `an Option` value
22
--> $DIR/unwrap.rs:5:13
33
|
44
LL | let _ = opt.unwrap();
55
| ^^^^^^^^^^^^
66
|
77
= note: `-D clippy::option-unwrap-used` implied by `-D warnings`
8+
= help: If you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message.
89

9-
error: used `unwrap()` on `a Result` value. If you don't want to handle the `Err` case gracefully, consider using `expect()` to provide a better panic message
10+
error: used `unwrap()` on `a Result` value
1011
--> $DIR/unwrap.rs:10:13
1112
|
1213
LL | let _ = res.unwrap();
1314
| ^^^^^^^^^^^^
1415
|
1516
= note: `-D clippy::result-unwrap-used` implied by `-D warnings`
17+
= help: If you don't want to handle the `Err` case gracefully, consider using `expect()` to provide a better panic message.
1618

1719
error: aborting due to 2 previous errors
1820

0 commit comments

Comments
 (0)