C headers: utility to generate c code from solc output #85
clippy
10 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 10 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0-beta.5 (ea9959354 2023-09-09)
- cargo 1.73.0-beta.5 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (ea99593 2023-09-09)
Annotations
Check warning on line 260 in src/cgen.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/cgen.rs:260:16
|
260 | 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 222 in src/cgen.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/cgen.rs:222:16
|
222 | 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 207 in src/cgen.rs
github-actions / clippy
`to_string` applied to a type that implements `Display` in `format!` args
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/cgen.rs:207:43
|
207 | ... offset.to_string(),
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: `#[warn(clippy::to_string_in_format_args)]` on by default
Check warning on line 165 in src/cgen.rs
github-actions / clippy
manual `!RangeInclusive::contains` implementation
warning: manual `!RangeInclusive::contains` implementation
--> src/cgen.rs:165:36
|
165 | ... if num > 32 || num < 0 {
| ^^^^^^^^^^^^^^^^^^^ help: use: `!(0..=32).contains(&num)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
Check warning on line 124 in src/cgen.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/cgen.rs:124:16
|
124 | 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 115 in src/cgen.rs
github-actions / clippy
useless use of `format!`
warning: useless use of `format!`
--> src/cgen.rs:115:29
|
115 | ... 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 66 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:66:17
|
66 | 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 55 in src/cgen.rs
github-actions / clippy
use of `or_insert` to construct default value
warning: use of `or_insert` to construct default value
--> src/cgen.rs:55:26
|
55 | .or_insert(Vec::default())
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
Check warning on line 38 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:38:29
|
38 | 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 34 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:34:22
|
34 | 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