mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
129 lines
4.1 KiB
Text
129 lines
4.1 KiB
Text
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:70:5
|
|
|
|
|
LL | Tuple(get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
|
= note: `-D clippy::unnecessary-operation` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_operation)]`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:71:5
|
|
|
|
|
LL | Struct { field: get_number() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:72:5
|
|
|
|
|
LL | Struct { ..get_struct() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_struct();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:73:5
|
|
|
|
|
LL | Enum::Tuple(get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:74:5
|
|
|
|
|
LL | Enum::Struct { field: get_number() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:75:5
|
|
|
|
|
LL | 5 + get_number();
|
|
| ^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:76:5
|
|
|
|
|
LL | *&get_number();
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:77:5
|
|
|
|
|
LL | &get_number();
|
|
| ^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:78:5
|
|
|
|
|
LL | (5, 6, get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;6;get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:79:5
|
|
|
|
|
LL | get_number()..;
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:80:5
|
|
|
|
|
LL | ..get_number();
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:81:5
|
|
|
|
|
LL | 5..get_number();
|
|
| ^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:82:5
|
|
|
|
|
LL | [42, get_number()];
|
|
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:83:5
|
|
|
|
|
LL | [42, 55][get_usize()];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:84:5
|
|
|
|
|
LL | (42, get_number()).1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:85:5
|
|
|
|
|
LL | [get_number(); 55];
|
|
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:86:5
|
|
|
|
|
LL | [42; 55][get_usize()];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42; 55].len() > get_usize());`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:87:5
|
|
|
|
|
LL | / {
|
|
LL | | get_number()
|
|
LL | | };
|
|
| |______^ help: statement can be reduced to: `get_number();`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:90:5
|
|
|
|
|
LL | / FooString {
|
|
LL | | s: String::from("blah"),
|
|
LL | | };
|
|
| |______^ help: statement can be reduced to: `String::from("blah");`
|
|
|
|
error: unnecessary operation
|
|
--> tests/ui/unnecessary_operation.rs:130:5
|
|
|
|
|
LL | [42, 55][get_usize()];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
|
|
|
|
error: aborting due to 20 previous errors
|
|
|