Skip to content

Commit 98d8b5e

Browse files
committed
allow let_unit_value
1 parent 0d692c2 commit 98d8b5e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

tests/ui/trim_split_whitespace.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::trim_split_whitespace)]
3+
#![allow(clippy::let_unit_value)]
34

45
struct Custom();
56
impl Custom {

tests/ui/trim_split_whitespace.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::trim_split_whitespace)]
3+
#![allow(clippy::let_unit_value)]
34

45
struct Custom();
56
impl Custom {

tests/ui/trim_split_whitespace.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
error: found call to `str::trim` before `str::split_whitespace`
2-
--> $DIR/trim_split_whitespace.rs:61:23
2+
--> $DIR/trim_split_whitespace.rs:62:23
33
|
44
LL | let _ = " A B C ".trim().split_whitespace(); // should trigger lint
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim()`: `split_whitespace()`
66
|
77
= note: `-D clippy::trim-split-whitespace` implied by `-D warnings`
88

99
error: found call to `str::trim_start` before `str::split_whitespace`
10-
--> $DIR/trim_split_whitespace.rs:62:23
10+
--> $DIR/trim_split_whitespace.rs:63:23
1111
|
1212
LL | let _ = " A B C ".trim_start().split_whitespace(); // should trigger lint
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim_start()`: `split_whitespace()`
1414

1515
error: found call to `str::trim_end` before `str::split_whitespace`
16-
--> $DIR/trim_split_whitespace.rs:63:23
16+
--> $DIR/trim_split_whitespace.rs:64:23
1717
|
1818
LL | let _ = " A B C ".trim_end().split_whitespace(); // should trigger lint
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim_end()`: `split_whitespace()`
2020

2121
error: found call to `str::trim` before `str::split_whitespace`
22-
--> $DIR/trim_split_whitespace.rs:66:37
22+
--> $DIR/trim_split_whitespace.rs:67:37
2323
|
2424
LL | let _ = (" A B C ").to_string().trim().split_whitespace(); // should trigger lint
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim()`: `split_whitespace()`
2626

2727
error: found call to `str::trim_start` before `str::split_whitespace`
28-
--> $DIR/trim_split_whitespace.rs:67:37
28+
--> $DIR/trim_split_whitespace.rs:68:37
2929
|
3030
LL | let _ = (" A B C ").to_string().trim_start().split_whitespace(); // should trigger lint
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim_start()`: `split_whitespace()`
3232

3333
error: found call to `str::trim_end` before `str::split_whitespace`
34-
--> $DIR/trim_split_whitespace.rs:68:37
34+
--> $DIR/trim_split_whitespace.rs:69:37
3535
|
3636
LL | let _ = (" A B C ").to_string().trim_end().split_whitespace(); // should trigger lint
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim_end()`: `split_whitespace()`
3838

3939
error: found call to `str::trim` before `str::split_whitespace`
40-
--> $DIR/trim_split_whitespace.rs:75:15
40+
--> $DIR/trim_split_whitespace.rs:76:15
4141
|
4242
LL | let _ = s.trim().split_whitespace(); // should trigger lint
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim()`: `split_whitespace()`
4444

4545
error: found call to `str::trim` before `str::split_whitespace`
46-
--> $DIR/trim_split_whitespace.rs:83:15
46+
--> $DIR/trim_split_whitespace.rs:84:15
4747
|
4848
LL | let _ = s.trim().split_whitespace(); // should trigger lint
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `trim()`: `split_whitespace()`

0 commit comments

Comments
 (0)