C headers: utility to generate c code from solc output #80
clippy
9 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 9 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.72.0 (5680fa18f 2023-08-23)
- cargo 1.72.0 (103a7ff2e 2023-08-15)
- clippy 0.1.72 (5680fa1 2023-08-23)
Annotations
Check warning on line 219 in src/cgen.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/cgen.rs:219:16
|
219 | if router_body.len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!router_body.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
Check warning on line 181 in src/cgen.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/cgen.rs:181:16
|
181 | if header_body.len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!header_body.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
Check warning on line 168 in src/cgen.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/cgen.rs:168:46
|
168 | header_body.push_str(&label);
| ^^^^^^ help: change this to: `label`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 161 in src/cgen.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/cgen.rs:161:46
|
161 | header_body.push_str(&label);
| ^^^^^^ help: change this to: `label`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 116 in src/cgen.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/cgen.rs:116:16
|
116 | if header_body.len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!header_body.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
Check warning on line 107 in src/cgen.rs
github-actions / clippy
useless use of `format!`
warning: useless use of `format!`
--> src/cgen.rs:107:29
|
107 | ... format!(" if (!bebi32_is_0(value)) revert();\n",).as_str(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `" if (!bebi32_is_0(value)) revert();\n".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
Check warning on line 58 in src/cgen.rs
github-actions / clippy
use Vec::sort_by_key here instead
warning: use Vec::sort_by_key here instead
--> src/cgen.rs:58:17
|
58 | overloads.sort_by(|a, b| a.signature().cmp(&b.signature()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `overloads.sort_by_key(|a| a.signature())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
= note: `#[warn(clippy::unnecessary_sort_by)]` on by default
Check warning on line 30 in src/cgen.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/cgen.rs:30:29
|
30 | debug_path.push(&contract_name);
| ^^^^^^^^^^^^^^ help: change this to: `contract_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 26 in src/cgen.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/cgen.rs:26:22
|
26 | pathbuf.push(&solidity_file_name);
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `solidity_file_name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default