feat: add support for multiple trees per file (#51) #117
ci.yml
on: push
lint
1m 24s
ubuntu / stable / coverage
2m 5s
Matrix: build
Annotations
80 warnings
redundant closure:
src/utils.rs#L88
warning: redundant closure
--> src/utils.rs:88:22
|
88 | .map(|s| s.trim())
| ^^^^^^^^^^^^ help: replace the closure with the method itself: `str::trim`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
= note: `#[warn(clippy::redundant_closure_for_method_calls)]` implied by `#[warn(clippy::pedantic)]`
|
empty String is being created manually:
src/utils.rs#L73
warning: empty String is being created manually
--> src/utils.rs:73:21
|
73 | result.push("".to_string());
| ^^^^^^^^^^^^^^ help: consider using: `String::new()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
= note: `#[warn(clippy::manual_string_new)]` implied by `#[warn(clippy::pedantic)]`
|
this loop could be written as a `for` loop:
src/utils.rs#L61
warning: this loop could be written as a `for` loop
--> src/utils.rs:61:5
|
61 | while let Some((index, match_str)) = iter.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for (index, match_str) in iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
= note: `#[warn(clippy::while_let_on_iterator)]` implied by `#[warn(clippy::all)]`
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/mod.rs#L14
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/mod.rs:14:1
|
14 | pub fn parse(text: &str) -> crate::error::Result<ast::Ast> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/visitor.rs#L23
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:23:5
|
23 | / fn visit_description(
24 | | &mut self,
25 | | description: &ast::Description,
26 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/visitor.rs#L21
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:21:5
|
21 | fn visit_action(&mut self, action: &ast::Action) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/visitor.rs#L19
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:19:5
|
19 | fn visit_condition(&mut self, condition: &ast::Condition) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/visitor.rs#L17
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:17:5
|
17 | fn visit_root(&mut self, root: &ast::Root) -> Result<Self::Output, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/tokenizer.rs#L156
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/tokenizer.rs:156:5
|
156 | pub fn tokenize(&mut self, text: &str) -> Result<Vec<Token>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/semantics.rs#L128
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/semantics.rs:128:5
|
128 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function which may panic missing `# Panics` section:
src/syntax/semantics.rs#L128
warning: docs for function which may panic missing `# Panics` section
--> src/syntax/semantics.rs:128:5
|
128 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/syntax/semantics.rs:129:9
|
129 | / match ast {
130 | | Ast::Root(root) => self.visit_root(root),
131 | | Ast::Condition(condition) => self.visit_condition(condition),
132 | | Ast::Action(action) => self.visit_action(action),
... |
136 | | // be stored in `self.errors`.
137 | | .unwrap();
| |_________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
variables can be used directly in the `format!` string:
src/syntax/semantics.rs#L84
warning: variables can be used directly in the `format!` string
--> src/syntax/semantics.rs:84:17
|
84 | write!(f, "found an identifier more than once in lines: {}", lines)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
84 - write!(f, "found an identifier more than once in lines: {}", lines)
84 + write!(f, "found an identifier more than once in lines: {lines}")
|
|
docs for function returning `Result` missing `# Errors` section:
src/syntax/parser.rs#L139
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/parser.rs:139:5
|
139 | pub fn parse(&mut self, text: &str, tokens: &[Token]) -> Result<Ast> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/sol/fmt.rs#L87
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/sol/fmt.rs:87:49
|
87 | parts.push(self.visit_contract_part(&mut p)?);
| ^^^^^^ help: change this to: `p`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
docs for function returning `Result` missing `# Errors` section:
src/scaffold/mod.rs#L113
warning: docs for function returning `Result` missing `# Errors` section
--> src/scaffold/mod.rs:113:5
|
113 | pub fn scaffold(&self, text: &str) -> crate::error::Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function which may panic missing `# Panics` section:
src/scaffold/mod.rs#L113
warning: docs for function which may panic missing `# Panics` section
--> src/scaffold/mod.rs:113:5
|
113 | pub fn scaffold(&self, text: &str) -> crate::error::Result<String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/mod.rs:117:25
|
117 | let formatted = fmt(&source).expect("should format the emitted solidity code");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
docs for function returning `Result` missing `# Errors` section:
src/scaffold/mod.rs#L45
warning: docs for function returning `Result` missing `# Errors` section
--> src/scaffold/mod.rs:45:5
|
45 | pub fn run(self) -> anyhow::Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function which may panic missing `# Panics` section:
src/scaffold/modifiers.rs#L41
warning: docs for function which may panic missing `# Panics` section
--> src/scaffold/modifiers.rs:41:5
|
41 | pub fn discover(&mut self, ast: &Ast) -> &IndexMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/modifiers.rs:44:17
|
44 | self.visit_root(root).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
item in documentation is missing backticks:
src/scaffold/modifiers.rs#L39
warning: item in documentation is missing backticks
--> src/scaffold/modifiers.rs:39:46
|
39 | /// `discover` is the entry point of the ModifierDiscoverer.
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
= note: `#[warn(clippy::doc_markdown)]` implied by `#[warn(clippy::pedantic)]`
help: try
|
39 | /// `discover` is the entry point of the `ModifierDiscoverer`.
| ~~~~~~~~~~~~~~~~~~~~
|
unused `self` argument:
src/scaffold/emitter.rs#L77
warning: unused `self` argument
--> src/scaffold/emitter.rs:77:29
|
77 | fn emit_contract_header(&self, contract: &hir::ContractDefinition) -> String {
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
|
redundant closure:
src/hir/mod.rs#L37
warning: redundant closure
--> src/hir/mod.rs:37:14
|
37 | .map(|tree| translate_tree_to_hir(tree))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `translate_tree_to_hir`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` implied by `#[warn(clippy::all)]`
|
item name ends with its containing module's name:
src/hir/mod.rs#L23
warning: item name ends with its containing module's name
--> src/hir/mod.rs:23:8
|
23 | pub fn translate_tree_to_hir(tree: &str) -> crate::error::Result<crate::hir::Hir> {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
= note: `#[warn(clippy::module_name_repetitions)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function returning `Result` missing `# Errors` section:
src/hir/mod.rs#L23
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/mod.rs:23:1
|
23 | pub fn translate_tree_to_hir(tree: &str) -> crate::error::Result<crate::hir::Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/hir/mod.rs#L15
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/mod.rs:15:1
|
15 | pub fn translate(text: &str) -> anyhow::Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/hir/visitor.rs#L60
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:60:5
|
60 | / fn visit_comment(&mut self, comment: &hir::Comment)
61 | | -> Result<Self::CommentOutput, Self::Error>;
| |____________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/hir/visitor.rs#L48
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:48:5
|
48 | / fn visit_function(
49 | | &mut self,
50 | | function: &hir::FunctionDefinition,
51 | | ) -> Result<Self::FunctionDefinitionOutput, Self::Error>;
| |_____________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/hir/visitor.rs#L37
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:37:5
|
37 | / fn visit_contract(
38 | | &mut self,
39 | | contract: &hir::ContractDefinition,
40 | | ) -> Result<Self::ContractDefinitionOutput, Self::Error>;
| |_____________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
docs for function returning `Result` missing `# Errors` section:
src/hir/visitor.rs#L29
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:29:5
|
29 | fn visit_root(&mut self, root: &hir::Root) -> Result<Self::RootOutput, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
|
accessing first element with `actions.get(0)`:
src/hir/translator.rs#L179
warning: accessing first element with `actions.get(0)`
--> src/hir/translator.rs:179:20
|
179 | && actions.get(0).is_some_and(|action| {
| ^^^^^^^^^^^^^^ help: try: `actions.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` implied by `#[warn(clippy::all)]`
|
module has the same name as its containing module:
src/hir/mod.rs#L5
warning: module has the same name as its containing module
--> src/hir/mod.rs:5:1
|
5 | pub mod hir;
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` implied by `#[warn(clippy::all)]`
|
unused `self` argument:
src/hir/combiner.rs#L185
warning: unused `self` argument
--> src/hir/combiner.rs:185:9
|
185 | &self,
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
|
unused `self` argument:
src/hir/combiner.rs#L171
warning: unused `self` argument
--> src/hir/combiner.rs:171:9
|
171 | &self,
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
|
implicitly cloning a `String` by calling `to_owned` on its dereferenced type:
src/hir/combiner.rs#L146
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
--> src/hir/combiner.rs:146:29
|
146 | ... contract_def.identifier.to_owned(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `contract_def.identifier.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
|
consider adding a `;` to the last statement for consistent formatting:
src/hir/combiner.rs#L145
warning: consider adding a `;` to the last statement for consistent formatting
--> src/hir/combiner.rs:145:25
|
145 | / Err(self.error(
146 | | contract_def.identifier.to_owned(),
147 | | Span::default(),
148 | | ErrorKind::ContractNameMismatch(
... |
151 | | ),
152 | | ))?
| |___________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
= note: `#[warn(clippy::semicolon_if_nothing_returned)]` implied by `#[warn(clippy::pedantic)]`
help: add a `;` here
|
145 ~ Err(self.error(
146 + contract_def.identifier.to_owned(),
147 + Span::default(),
148 + ErrorKind::ContractNameMismatch(
149 + contract_identifier,
150 + accumulated_identifier,
151 + ),
152 + ))?;
|
|
implicitly cloning a `String` by calling `to_owned` on its dereferenced type:
src/hir/combiner.rs#L125
warning: implicitly cloning a `String` by calling `to_owned` on its dereferenced type
--> src/hir/combiner.rs:125:49
|
125 | child_contract.identifier = contract_identifier.to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `contract_identifier.clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
= note: `#[warn(clippy::implicit_clone)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function returning `Result` missing `# Errors` section:
src/hir/combiner.rs#L102
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/combiner.rs:102:5
|
102 | pub fn combine(&self, hirs: &Vec<Hir>) -> Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function which may panic missing `# Panics` section:
src/hir/combiner.rs#L102
warning: docs for function which may panic missing `# Panics` section
--> src/hir/combiner.rs:102:5
|
102 | pub fn combine(&self, hirs: &Vec<Hir>) -> Result<Hir> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/hir/combiner.rs:123:47
|
123 | let contract_identifier = contract_identifier_option
| _______________________________________________^
124 | | .expect("expected contract identifier at tree root");
| |____________________________________________________________________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
|
unused `self` argument:
src/hir/combiner.rs#L94
warning: unused `self` argument
--> src/hir/combiner.rs:94:14
|
94 | fn error(&self, text: String, span: Span, kind: ErrorKind) -> Error {
| ^^^^^
|
= help: consider refactoring to an associated function
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
|
you should consider adding a `Default` implementation for `Combiner`:
src/hir/combiner.rs#L89
warning: you should consider adding a `Default` implementation for `Combiner`
--> src/hir/combiner.rs:89:5
|
89 | / pub fn new() -> Self {
90 | | Combiner {}
91 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` implied by `#[warn(clippy::all)]`
help: try adding this
|
86 + impl Default for Combiner {
87 + fn default() -> Self {
88 + Self::new()
89 + }
90 + }
|
|
passing a unit value to a function:
src/cli.rs#L25
warning: passing a unit value to a function
--> src/cli.rs:25:37
|
25 | Commands::Check(command) => Ok(command.run()),
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: `#[warn(clippy::unit_arg)]` implied by `#[warn(clippy::all)]`
help: move the expression in front of the call and replace it with the unit literal `()`
|
25 ~ Commands::Check(command) => {
26 + command.run();
27 + Ok(())
28 ~ },
|
|
variables can be used directly in the `format!` string:
src/check/mod.rs#L145
warning: variables can be used directly in the `format!` string
--> src/check/mod.rs:145:13
|
145 | / eprintln!(
146 | | " (run `bulloak check --fix <.tree files>` to apply {} {})",
147 | | fixable_count, fix_literal
148 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function which may panic missing `# Panics` section:
src/check/mod.rs#L46
warning: docs for function which may panic missing `# Panics` section
--> src/check/mod.rs:46:5
|
46 | pub fn run(self) {
| ^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/check/mod.rs:87:33
|
87 | let formatted = ctx.fmt().expect("should format the emitted solidity code");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
note: the lint level is defined here
--> src/lib.rs:3:22
|
3 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
|
you seem to be trying to use `&Box<T>`. Consider using just `&T`:
src/check/violation.rs#L329
warning: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> src/check/violation.rs:329:19
|
329 | contract_sol: &Box<ContractDefinition>,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&ContractDefinition`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box
= note: `#[warn(clippy::borrowed_box)]` implied by `#[warn(clippy::all)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/check/violation.rs#L280
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/check/violation.rs:280:40
|
280 | let prev_fn = find_matching_fn(&contract_sol, pre_fn_hir);
| ^^^^^^^^^^^^^ help: change this to: `contract_sol`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
|
unneeded `return` statement:
src/check/violation.rs#L40
warning: unneeded `return` statement
--> src/check/violation.rs:40:9
|
40 | / return matches!(
41 | | self.kind,
42 | | ViolationKind::ContractMissing(_)
43 | | | ViolationKind::ContractNameNotMatches(_, _)
44 | | | ViolationKind::FunctionOrderMismatch(_, _, _)
45 | | | ViolationKind::MatchingFunctionMissing(_, _)
46 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` implied by `#[warn(clippy::all)]`
help: remove `return`
|
40 ~ matches!(
41 + self.kind,
42 + ViolationKind::ContractMissing(_)
43 + | ViolationKind::ContractNameNotMatches(_, _)
44 + | ViolationKind::FunctionOrderMismatch(_, _, _)
45 + | ViolationKind::MatchingFunctionMissing(_, _)
46 ~ )
|
|
the loop variable `j` is only used to index `present_fn_indices`:
src/check/rules/structural_match.rs#L156
warning: the loop variable `j` is only used to index `present_fn_indices`
--> src/check/rules/structural_match.rs:156:18
|
156 | for j in i + 1..present_fn_indices.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` implied by `#[warn(clippy::all)]`
help: consider using an iterator
|
156 | for <item> in present_fn_indices.iter().skip(i + 1) {
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
methods called `from_*` usually take no `self`:
src/check/context.rs#L71
warning: methods called `from_*` usually take no `self`
--> src/check/context.rs:71:31
|
71 | pub(crate) fn from_parsed(mut self, parsed: Parsed) -> Self {
| ^^^^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
note: the lint level is defined here
--> src/lib.rs:3:9
|
3 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::wrong_self_convention)]` implied by `#[warn(clippy::all)]`
|
multiple versions for dependency `yansi`: 0.5.1, 1.0.0-rc.1:
src/lib.rs#L1
warning: multiple versions for dependency `yansi`: 0.5.1, 1.0.0-rc.1
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `toml_edit`: 0.19.15, 0.20.7, 0.21.0:
src/lib.rs#L1
warning: multiple versions for dependency `toml_edit`: 0.19.15, 0.20.7, 0.21.0
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `toml`: 0.7.8, 0.8.8:
src/lib.rs#L1
warning: multiple versions for dependency `toml`: 0.7.8, 0.8.8
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `syn`: 1.0.109, 2.0.39:
src/lib.rs#L1
warning: multiple versions for dependency `syn`: 1.0.109, 2.0.39
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `socket2`: 0.4.10, 0.5.5:
src/lib.rs#L1
warning: multiple versions for dependency `socket2`: 0.4.10, 0.5.5
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `proc-macro-crate`: 1.3.1, 2.0.0:
src/lib.rs#L1
warning: multiple versions for dependency `proc-macro-crate`: 1.3.1, 2.0.0
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `bitflags`: 1.3.2, 2.4.1:
src/lib.rs#L1
warning: multiple versions for dependency `bitflags`: 1.3.2, 2.4.1
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `alloy-primitives`: 0.3.3, 0.4.2:
src/lib.rs#L1
warning: multiple versions for dependency `alloy-primitives`: 0.3.3, 0.4.2
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
note: the lint level is defined here
--> src/lib.rs:3:40
|
3 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^^^
= note: `#[warn(clippy::multiple_crate_versions)]` implied by `#[warn(clippy::cargo)]`
|
lint
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
lint
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
lint
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (ubuntu-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (ubuntu-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
build (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
ubuntu / stable / coverage
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, codecov/codecov-action@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (macOS-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (macOS-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
build (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (windows-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
build (windows-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
build (windows-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (windows-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (windows-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build (windows-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|