C headers: utility to generate c code from solc output #80
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#L219
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
|
length comparison to zero:
src/cgen.rs#L181
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L168
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L161
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
|
length comparison to zero:
src/cgen.rs#L116
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
|
useless use of `format!`:
src/cgen.rs#L107
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
|
use Vec::sort_by_key here instead:
src/cgen.rs#L58
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
|
use of `or_insert` to construct default value:
src/cgen.rs#L47
warning: use of `or_insert` to construct default value
--> src/cgen.rs:47:26
|
47 | .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#L30
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
|
the borrowed expression implements the required traits:
src/cgen.rs#L26
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
|
length comparison to zero:
src/cgen.rs#L219
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
|
length comparison to zero:
src/cgen.rs#L181
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L168
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L161
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
|
length comparison to zero:
src/cgen.rs#L116
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
|
useless use of `format!`:
src/cgen.rs#L107
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
|
use Vec::sort_by_key here instead:
src/cgen.rs#L58
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/cgen.rs#L30
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
|
the borrowed expression implements the required traits:
src/cgen.rs#L26
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
|