lint: add better rust formatting #158
reviewdog [clippy] report
reported by reviewdog 🐶
Findings (9)
src/check/context.rs|56 col 58| warning: calling Config::default()
is more clear than this expression
--> src/check/context.rs:56:58
|
56 | let hir = crate::hir::translate(&tree_contents, &Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: Config::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
= note: #[warn(clippy::default_trait_access)]
implied by #[warn(clippy::pedantic)]
src/check/rules/structural_match.rs|142 col 21| warning: consider adding a ;
to the last statement for consistent formatting
--> src/check/rules/structural_match.rs:142:21
|
142 | present_fn_indices.push((hir_idx, sol_idx))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a ;
here: present_fn_indices.push((hir_idx, sol_idx));
|
= 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)]
src/check/violation.rs|196 col 48| warning: calling Config::default()
is more clear than this expression
--> src/check/violation.rs:196:48
|
196 | let pt = sol::Translator::new(&Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: Config::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
src/hir/visitor.rs|32 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/hir/visitor.rs:32:5
|
32 | / fn visit_root(
33 | | &mut self,
34 | | root: &hir::Root,
35 | | ) -> Result<Self::RootOutput, Self::Error>;
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/visitor.rs|70 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/hir/visitor.rs:70:5
|
70 | / fn visit_comment(
71 | | &mut self,
72 | | comment: &hir::Comment,
73 | | ) -> Result<Self::CommentOutput, Self::Error>;
| |___^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/scaffold/emitter.rs|91 col 9| warning: unused self
argument
--> src/scaffold/emitter.rs:91:9
|
91 | &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
= note: #[warn(clippy::unused_self)]
implied by #[warn(clippy::pedantic)]
src/syntax/visitor.rs|17 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/visitor.rs:17:5
|
17 | / fn visit_root(
18 | | &mut self,
19 | | root: &ast::Root,
20 | | ) -> Result<Self::Output, Self::Error>;
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/syntax/visitor.rs|22 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/visitor.rs:22:5
|
22 | / fn visit_condition(
23 | | &mut self,
24 | | condition: &ast::Condition,
25 | | ) -> Result<Self::Output, Self::Error>;
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/syntax/visitor.rs|27 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/visitor.rs:27:5
|
27 | / fn visit_action(
28 | | &mut self,
29 | | action: &ast::Action,
30 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Filtered Findings (45)
README.md|18 col 6| warning: item in documentation is missing backticks
--> src/../README.md:18:6
|
18 | - VSCode
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
note: the lint level is defined here
--> src/lib.rs:3:22
|
3 | #![warn(clippy::all, clippy::pedantic, clippy::cargo)]
| ^^^^^^^^^^^^^^^^
= note: #[warn(clippy::doc_markdown)]
implied by #[warn(clippy::pedantic)]
help: try
|
18 | - VSCode
| ~~~~~~~~
README.md|44 col 5| warning: item in documentation is missing backticks
--> src/../README.md:44:5
|
44 | ### VSCode
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
44 | ### VSCode
| ~~~~~~~~
README.md|46 col 15| warning: item in documentation is missing backticks
--> src/../README.md:46:15
|
46 | The following VSCode extensions are not essential but they are recommended for a
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
46 | The following VSCode
extensions are not essential but they are recommended for a
| ~~~~~~~~
README.md|403 col 3| warning: you should put bare URLs between <
/>
or make a proper Markdown link
--> src/../README.md:403:3
|
403 | https://www.apache.org/licenses/LICENSE-2.0).
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
README.md|405 col 3| warning: you should put bare URLs between <
/>
or make a proper Markdown link
--> src/../README.md:405:3
|
405 | https://opensource.org/licenses/MIT).
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
src/lib.rs|1 col 1| 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)]
src/lib.rs|1 col 1| 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
src/lib.rs|1 col 1| 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
src/lib.rs|1 col 1| 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
src/lib.rs|1 col 1| warning: multiple versions for dependency syn
: 1.0.109, 2.0.66
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
src/lib.rs|1 col 1| 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
src/lib.rs|1 col 1| 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
src/lib.rs|1 col 1| 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
src/check/context.rs|53 col 43| warning: this argument is passed by value, but not consumed in the function body
--> src/check/context.rs:53:43
|
53 | pub(crate) fn new(tree: PathBuf, cfg: Config) -> Result<Self, Violation> {
| ^^^^^^ help: consider taking a reference instead: &Config
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: #[warn(clippy::needless_pass_by_value)]
implied by #[warn(clippy::pedantic)]
src/check/context.rs|83 col 31| warning: methods called from_*
usually take no self
--> src/check/context.rs:83:31
|
83 | 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)]
src/check/context.rs|127 col 20| warning: calling Config::default()
is more clear than this expression
--> src/check/context.rs:127:20
|
127 | let cfg = &Default::default();
| ^^^^^^^^^^^^^^^^^^ help: try: Config::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
src/check/rules/structural_match.rs|148 col 25| warning: consider adding a ;
to the last statement for consistent formatting
--> src/check/rules/structural_match.rs:148:25
|
148 | / violations.push(Violation::new(
149 | | ViolationKind::MatchingFunctionMissing(
150 | | fn_hir.clone(),
151 | | hir_idx,
... |
156 | | ),
157 | | ))
| |____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
help: add a ;
here
|
148 ~ violations.push(Violation::new(
149 + ViolationKind::MatchingFunctionMissing(
150 + fn_hir.clone(),
151 + hir_idx,
152 + ),
153 + Location::Code(
154 + ctx.tree.to_string_lossy().into_owned(),
155 + fn_hir.span.start.line,
156 + ),
157 + ));
|
src/check/rules/structural_match.rs|177 col 18| warning: the loop variable j
is only used to index present_fn_indices
--> src/check/rules/structural_match.rs:177:18
|
177 | 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
|
177 | for in present_fn_indices.iter().skip(i + 1) {
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/check/violation.rs|345 col 19| warning: you seem to be trying to use &Box<T>
. Consider using just &T
--> src/check/violation.rs:345:19
|
345 | contract_sol: &Box,
| ^^^^^^^^^^^^^^^^^^^^^^^^ 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)]
src/check/mod.rs|55 col 5| warning: this function's return value is unnecessary
--> src/check/mod.rs:55:5
|
55 | / pub(crate) fn run(&self, cfg: &Config) -> anyhow::Result<()> {
56 | | let mut violations = Vec::new();
57 | | let ctxs: Vec = self
58 | | .files
... |
134 | | Ok(())
135 | | }
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
= note: #[warn(clippy::unnecessary_wraps)]
implied by #[warn(clippy::pedantic)]
help: remove the return type...
|
55 | pub(crate) fn run(&self, cfg: &Config) -> anyhow::Result<()> {
| ~~~~~~~~~~~~~~~~~~
help: ...and then remove returned values
|
134 - Ok(())
134 +
|
src/config.rs|48 col 24| warning: calling Scaffold::default()
is more clear than this expression
--> src/config.rs:48:24
|
48 | Self::Scaffold(Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: Scaffold::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
src/config.rs|53 col 1| warning: docs for function returning Result
missing # Errors
section
--> src/config.rs:53:1
|
53 | pub fn run() -> anyhow::Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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)]
src/config.rs|68 col 13| warning: wildcard matches only a single variant and will also match any future added variants
--> src/config.rs:68:13
|
68 | _ => Default::default(),
| ^ help: try: Commands::Check(_)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
= note: #[warn(clippy::match_wildcard_for_single_variants)]
implied by #[warn(clippy::pedantic)]
src/config.rs|68 col 18| warning: calling Scaffold::default()
is more clear than this expression
--> src/config.rs:68:18
|
68 | _ => Default::default(),
| ^^^^^^^^^^^^^^^^^^ help: try: Scaffold::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
src/config.rs|77 col 13| warning: wildcard matches only a single variant and will also match any future added variants
--> src/config.rs:77:13
|
77 | _ => Default::default(),
| ^ help: try: Commands::Scaffold(_)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants
src/config.rs|77 col 18| warning: calling Check::default()
is more clear than this expression
--> src/config.rs:77:18
|
77 | _ => Default::default(),
| ^^^^^^^^^^^^^^^^^^ help: try: Check::default()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
src/hir/combiner.rs|98 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/hir/combiner.rs:98:5
|
98 | pub fn combine(self, text: &str, hirs: Vec) -> Result {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/visitor.rs|44 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/hir/visitor.rs:44:5
|
44 | / fn visit_contract(
45 | | &mut self,
46 | | contract: &hir::ContractDefinition,
47 | | ) -> Result<Self::ContractDefinitionOutput, Self::Error>;
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/visitor.rs|56 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/hir/visitor.rs:56:5
|
56 | / fn visit_function(
57 | | &mut self,
58 | | function: &hir::FunctionDefinition,
59 | | ) -> Result<Self::FunctionDefinitionOutput, Self::Error>;
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/visitor.rs|82 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/hir/visitor.rs:82:5
|
82 | / fn visit_statement(
83 | | &mut self,
84 | | statement: &hir::Statement,
85 | | ) -> Result<Self::StatementOutput, Self::Error>;
| |_________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/mod.rs|22 col 1| warning: docs for function returning Result
missing # Errors
section
--> src/hir/mod.rs:22:1
|
22 | pub fn translate(text: &str, cfg: &Config) -> anyhow::Result {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/mod.rs|47 col 1| warning: docs for function returning Result
missing # Errors
section
--> src/hir/mod.rs:47:1
|
47 | pub fn translate_tree_to_hir(tree: &str, cfg: &Config) -> error::Result {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/hir/mod.rs|47 col 8| warning: item name ends with its containing module's name
--> src/hir/mod.rs:47:8
|
47 | pub fn translate_tree_to_hir(tree: &str, cfg: &Config) -> error::Result {
| ^^^^^^^^^^^^^^^^^^^^^
|
= 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)]
src/scaffold/modifiers.rs|42 col 5| warning: docs for function which may panic missing # Panics
section
--> src/scaffold/modifiers.rs:42:5
|
42 | pub fn discover(&mut self, ast: &Ast) -> &IndexMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/modifiers.rs:45:17
|
45 | self.visit_root(root).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
= note: #[warn(clippy::missing_panics_doc)]
implied by #[warn(clippy::pedantic)]
src/scaffold/mod.rs|26 col 1| warning: more than 3 bools in a struct
--> src/scaffold/mod.rs:26:1
|
26 | / pub struct Scaffold {
27 | | /// The set of tree files to generate from.
28 | | ///
29 | | /// Each Solidity file will be named after its matching
... |
57 | | pub skip_modifiers: bool,
58 | | }
| |^
|
= help: consider using a state machine or refactoring bools into two-variant enums
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#struct_excessive_bools
= note: #[warn(clippy::struct_excessive_bools)]
implied by #[warn(clippy::pedantic)]
src/scaffold/mod.rs|148 col 1| warning: docs for function which may panic missing # Panics
section
--> src/scaffold/mod.rs:148:1
|
148 | pub fn scaffold(text: &str, cfg: &Config) -> crate::error::Result {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/scaffold/mod.rs:153:9
|
153 | 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
src/scaffold/mod.rs|148 col 1| warning: docs for function returning Result
missing # Errors
section
--> src/scaffold/mod.rs:148:1
|
148 | pub fn scaffold(text: &str, cfg: &Config) -> crate::error::Result {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/syntax/parser.rs|130 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/parser.rs:130:5
|
130 | pub fn parse(&mut self, text: &str, tokens: &[Token]) -> Result {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/syntax/semantics.rs|17 col 48| warning: called .collect::<Vec<String>>().join("")
on an iterator
--> src/syntax/semantics.rs:17:48
|
17 | #[error("{}", .0.iter().map(|e| e.to_string()).collect::<Vec<>>().join(""))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: collect::<String>()
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_join
= note: #[warn(clippy::unnecessary_join)]
implied by #[warn(clippy::pedantic)]
src/syntax/semantics.rs|17 col 29| warning: redundant closure
--> src/syntax/semantics.rs:17:29
|
17 | #[error("{}", .0.iter().map(|e| e.to_string()).collect::<Vec<>>().join(""))]
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: std::string::ToString::to_string
|
= 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)]
src/syntax/semantics.rs|117 col 5| warning: docs for function which may panic missing # Panics
section
--> src/syntax/semantics.rs:117:5
|
117 | pub fn analyze(&mut self, ast: &ast::Ast) -> Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> src/syntax/semantics.rs:118:9
|
118 | / match ast {
119 | | Ast::Root(root) => self.visit_root(root),
120 | | Ast::Condition(condition) => self.visit_condition(condition),
121 | | Ast::Action(action) => self.visit_action(action),
... |
127 | | // be stored in self.errors
.
128 | | .unwrap();
| |^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
src/syntax/semantics.rs|117 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/semantics.rs:117:5
|
117 | 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
src/syntax/tokenizer.rs|146 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/tokenizer.rs:146:5
|
146 | pub fn tokenize(&mut self, text: &str) -> Result<Vec> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/syntax/visitor.rs|32 col 5| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/visitor.rs:32:5
|
32 | / fn visit_description(
33 | | &mut self,
34 | | description: &ast::Description,
35 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
src/syntax/mod.rs|14 col 1| warning: docs for function returning Result
missing # Errors
section
--> src/syntax/mod.rs:14:1
|
14 | pub fn parse(text: &str) -> crate::error::Resultast::Ast {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Annotations
Check warning on line 56 in src/check/context.rs
github-actions / clippy
[clippy] src/check/context.rs#L56
warning: calling `Config::default()` is more clear than this expression
--> src/check/context.rs:56:58
|
56 | let hir = crate::hir::translate(&tree_contents, &Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: `Config::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
= note: `#[warn(clippy::default_trait_access)]` implied by `#[warn(clippy::pedantic)]`
Raw output
src/check/context.rs:56:58:w:warning: calling `Config::default()` is more clear than this expression
--> src/check/context.rs:56:58
|
56 | let hir = crate::hir::translate(&tree_contents, &Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: `Config::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
= note: `#[warn(clippy::default_trait_access)]` implied by `#[warn(clippy::pedantic)]`
__END__
Check warning on line 142 in src/check/rules/structural_match.rs
github-actions / clippy
[clippy] src/check/rules/structural_match.rs#L142
warning: consider adding a `;` to the last statement for consistent formatting
--> src/check/rules/structural_match.rs:142:21
|
142 | present_fn_indices.push((hir_idx, sol_idx))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `present_fn_indices.push((hir_idx, sol_idx));`
|
= 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)]`
Raw output
src/check/rules/structural_match.rs:142:21:w:warning: consider adding a `;` to the last statement for consistent formatting
--> src/check/rules/structural_match.rs:142:21
|
142 | present_fn_indices.push((hir_idx, sol_idx))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `present_fn_indices.push((hir_idx, sol_idx));`
|
= 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)]`
__END__
Check warning on line 196 in src/check/violation.rs
github-actions / clippy
[clippy] src/check/violation.rs#L196
warning: calling `Config::default()` is more clear than this expression
--> src/check/violation.rs:196:48
|
196 | let pt = sol::Translator::new(&Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: `Config::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
Raw output
src/check/violation.rs:196:48:w:warning: calling `Config::default()` is more clear than this expression
--> src/check/violation.rs:196:48
|
196 | let pt = sol::Translator::new(&Default::default())
| ^^^^^^^^^^^^^^^^^^ help: try: `Config::default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
__END__
Check warning on line 32 in src/hir/visitor.rs
github-actions / clippy
[clippy] src/hir/visitor.rs#L32
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:32:5
|
32 | / fn visit_root(
33 | | &mut self,
34 | | root: &hir::Root,
35 | | ) -> Result<Self::RootOutput, Self::Error>;
| |_______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Raw output
src/hir/visitor.rs:32:5:w:warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:32:5
|
32 | / fn visit_root(
33 | | &mut self,
34 | | root: &hir::Root,
35 | | ) -> Result<Self::RootOutput, Self::Error>;
| |_______________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
__END__
Check warning on line 70 in src/hir/visitor.rs
github-actions / clippy
[clippy] src/hir/visitor.rs#L70
warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:70:5
|
70 | / fn visit_comment(
71 | | &mut self,
72 | | comment: &hir::Comment,
73 | | ) -> Result<Self::CommentOutput, Self::Error>;
| |__________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Raw output
src/hir/visitor.rs:70:5:w:warning: docs for function returning `Result` missing `# Errors` section
--> src/hir/visitor.rs:70:5
|
70 | / fn visit_comment(
71 | | &mut self,
72 | | comment: &hir::Comment,
73 | | ) -> Result<Self::CommentOutput, Self::Error>;
| |__________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
__END__
Check warning on line 91 in src/scaffold/emitter.rs
github-actions / clippy
[clippy] src/scaffold/emitter.rs#L91
warning: unused `self` argument
--> src/scaffold/emitter.rs:91:9
|
91 | &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
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
Raw output
src/scaffold/emitter.rs:91:9:w:warning: unused `self` argument
--> src/scaffold/emitter.rs:91:9
|
91 | &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
= note: `#[warn(clippy::unused_self)]` implied by `#[warn(clippy::pedantic)]`
__END__
Check warning on line 17 in src/syntax/visitor.rs
github-actions / clippy
[clippy] src/syntax/visitor.rs#L17
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:17:5
|
17 | / fn visit_root(
18 | | &mut self,
19 | | root: &ast::Root,
20 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Raw output
src/syntax/visitor.rs:17:5:w:warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:17:5
|
17 | / fn visit_root(
18 | | &mut self,
19 | | root: &ast::Root,
20 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
__END__
Check warning on line 22 in src/syntax/visitor.rs
github-actions / clippy
[clippy] src/syntax/visitor.rs#L22
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:22:5
|
22 | / fn visit_condition(
23 | | &mut self,
24 | | condition: &ast::Condition,
25 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Raw output
src/syntax/visitor.rs:22:5:w:warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:22:5
|
22 | / fn visit_condition(
23 | | &mut self,
24 | | condition: &ast::Condition,
25 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
__END__
Check warning on line 27 in src/syntax/visitor.rs
github-actions / clippy
[clippy] src/syntax/visitor.rs#L27
warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:27:5
|
27 | / fn visit_action(
28 | | &mut self,
29 | | action: &ast::Action,
30 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
Raw output
src/syntax/visitor.rs:27:5:w:warning: docs for function returning `Result` missing `# Errors` section
--> src/syntax/visitor.rs:27:5
|
27 | / fn visit_action(
28 | | &mut self,
29 | | action: &ast::Action,
30 | | ) -> Result<Self::Output, Self::Error>;
| |___________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
__END__