mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
124 lines
3.7 KiB
Text
124 lines
3.7 KiB
Text
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:48:5
|
|
|
|
|
48 | Tuple(get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
|
= note: `-D clippy::unnecessary-operation` implied by `-D warnings`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:49:5
|
|
|
|
|
49 | Struct { field: get_number() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:50:5
|
|
|
|
|
50 | Struct { ..get_struct() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_struct();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:51:5
|
|
|
|
|
51 | Enum::Tuple(get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:52:5
|
|
|
|
|
52 | Enum::Struct { field: get_number() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:53:5
|
|
|
|
|
53 | 5 + get_number();
|
|
| ^^^^^^^^^^^^^^^^^ help: replace it with: `5;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:54:5
|
|
|
|
|
54 | *&get_number();
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:55:5
|
|
|
|
|
55 | &get_number();
|
|
| ^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:56:5
|
|
|
|
|
56 | (5, 6, get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `5;6;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:57:5
|
|
|
|
|
57 | box get_number();
|
|
| ^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:58:5
|
|
|
|
|
58 | get_number()..;
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:59:5
|
|
|
|
|
59 | ..get_number();
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:60:5
|
|
|
|
|
60 | 5..get_number();
|
|
| ^^^^^^^^^^^^^^^^ help: replace it with: `5;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:61:5
|
|
|
|
|
61 | [42, get_number()];
|
|
| ^^^^^^^^^^^^^^^^^^^ help: replace it with: `42;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:62:5
|
|
|
|
|
62 | [42, 55][get_number() as usize];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `[42, 55];get_number() as usize;`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:63:5
|
|
|
|
|
63 | (42, get_number()).1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `42;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:64:5
|
|
|
|
|
64 | [get_number(); 55];
|
|
| ^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:65:5
|
|
|
|
|
65 | [42; 55][get_number() as usize];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `[42; 55];get_number() as usize;`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:66:5
|
|
|
|
|
66 | {get_number()};
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/unnecessary_operation.rs:67:5
|
|
|
|
|
67 | FooString { s: String::from("blah"), };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `String::from("blah");`
|
|
|
|
error: aborting due to 20 previous errors
|
|
|