C headers: utility to generate c code from solc output #85
Triggered via pull request
September 17, 2023 18:37
Status
Success
Total duration
10m 5s
Artifacts
–
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
19 warnings
length comparison to zero:
src/cgen.rs#L260
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
|
length comparison to zero:
src/cgen.rs#L222
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
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/cgen.rs#L207
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
|
manual `!RangeInclusive::contains` implementation:
src/cgen.rs#L165
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
|
length comparison to zero:
src/cgen.rs#L124
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
|
useless use of `format!`:
src/cgen.rs#L115
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
|
use Vec::sort_by_key here instead:
src/cgen.rs#L66
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
|
use of `or_insert` to construct default value:
src/cgen.rs#L55
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L38
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
|
the borrowed expression implements the required traits:
src/cgen.rs#L34
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
|
length comparison to zero:
src/cgen.rs#L260
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
|
length comparison to zero:
src/cgen.rs#L222
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
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/cgen.rs#L207
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
|
manual `!RangeInclusive::contains` implementation:
src/cgen.rs#L165
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
|
length comparison to zero:
src/cgen.rs#L124
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
|
useless use of `format!`:
src/cgen.rs#L115
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
|
use Vec::sort_by_key here instead:
src/cgen.rs#L66
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L38
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
|
the borrowed expression implements the required traits:
src/cgen.rs#L34
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
|