Fix errors reported by lint #![deny(rust_2018_idioms)]
#2452
clippy
1 error, 12993 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 1 |
Warning | 12993 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.76.0 (07dca489a 2024-02-04)
- cargo 1.76.0 (c84b36747 2024-01-18)
- clippy 0.1.76 (07dca48 2024-02-04)
Annotations
Check warning on line 98 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:98:5
|
98 | pub errors: Vec<ParseError<'input>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 97 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:97:5
|
97 | pub offsets: LineOffsetTracker,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 96 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:96:5
|
96 | pub text: &'input str,
| ^^^^^^^^^^^^^^^^^^^^^
Check warning on line 87 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:87:5
|
87 | pub locations: LocationMap,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 86 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:86:5
|
86 | pub ast: ast::AstNode<ast::TopLevelQuery>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 85 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:85:5
|
85 | pub offsets: LineOffsetTracker,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 84 in partiql-parser/src/lib.rs
github-actions / clippy
missing documentation for a struct field
warning: missing documentation for a struct field
--> partiql-parser/src/lib.rs:84:5
|
84 | pub text: &'input str,
| ^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> partiql-parser/src/lib.rs:2:9
|
2 | #![warn(missing_docs, missing_debug_implementations)]
| ^^^^^^^^^^^^
Check warning on line 90 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:90:39
|
90 | /// The output of errors when parsing PartiQL statement strings: an errors and auxiliary data.
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
90 | /// The output of errors when parsing `PartiQL` statement strings: an errors and auxiliary data.
| ~~~~~~~~~
Check warning on line 78 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:78:27
|
78 | /// The output of parsing PartiQL statement strings: an AST and auxiliary data.
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
78 | /// The output of parsing `PartiQL` statement strings: an AST and auxiliary data.
| ~~~~~~~~~
Check warning on line 57 in partiql-parser/src/lib.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> partiql-parser/src/lib.rs:57:5
|
57 | pub fn parse<'input>(&self, text: &'input str) -> ParserResult<'input> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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)]`
Check warning on line 56 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:56:17
|
56 | /// Parse a PartiQL statement into an AST.
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
56 | /// Parse a `PartiQL` statement into an AST.
| ~~~~~~~~~
Check warning on line 50 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:50:7
|
50 | /// A PartiQL parser from statement strings to AST.
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
50 | /// A `PartiQL` parser from statement strings to AST.
| ~~~~~~~~~
Check warning on line 47 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:47:37
|
47 | /// General [`Result`] type for the PartiQL [`Parser`].
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
47 | /// General [`Result`] type for the `PartiQL` [`Parser`].
| ~~~~~~~~~
Check warning on line 44 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:44:78
|
44 | /// [`std::error::Error`] type for errors in the syntactic structure for the PartiQL parser.
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
44 | /// [`std::error::Error`] type for errors in the syntactic structure for the `PartiQL` parser.
| ~~~~~~~~~
Check warning on line 41 in partiql-parser/src/lib.rs
github-actions / clippy
item in documentation is missing backticks
warning: item in documentation is missing backticks
--> partiql-parser/src/lib.rs:41:76
|
41 | /// [`std::error::Error`] type for errors in the lexical structure for the PartiQL parser.
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
41 | /// [`std::error::Error`] type for errors in the lexical structure for the `PartiQL` parser.
| ~~~~~~~~~
Check warning on line 31 in partiql-parser/src/token_parser.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> partiql-parser/src/token_parser.rs:31:21
|
31 | Some(Ok(_)) => {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 605 in partiql-parser/src/preprocessor.rs
github-actions / clippy
redundant closure
warning: redundant closure
--> partiql-parser/src/preprocessor.rs:605:43
|
605 | self.next().map(|res| res.map_err(|e| e.into()))
| ^^^^^^^^^^^^ help: replace the closure with the method itself: `std::convert::Into::into`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
Check warning on line 603 in partiql-parser/src/preprocessor.rs
github-actions / clippy
you have declared `#[inline(always)]` on `next`. This is usually a bad idea
warning: you have declared `#[inline(always)]` on `next`. This is usually a bad idea
--> partiql-parser/src/preprocessor.rs:603:5
|
603 | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
Check warning on line 590 in partiql-parser/src/preprocessor.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> partiql-parser/src/preprocessor.rs:590:13
|
590 | rewrite.push(t)
| ^^^^^^^^^^^^^^^ help: add a `;` here: `rewrite.push(t);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
Check warning on line 506 in partiql-parser/src/preprocessor.rs
github-actions / clippy
usage of wildcard import for enum variants
warning: usage of wildcard import for enum variants
--> partiql-parser/src/preprocessor.rs:506:13
|
506 | use FnExprArgMatch::*;
| ^^^^^^^^^^^^^^^^^ help: try: `FnExprArgMatch::{AnyOne, AnyZeroOrMore, Match, NamedArgId, NamedArgKw, Synthesize}`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use
= note: `#[warn(clippy::enum_glob_use)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 466 in partiql-parser/src/preprocessor.rs
github-actions / clippy
this argument is passed by value, but not consumed in the function body
warning: this argument is passed by value, but not consumed in the function body
--> partiql-parser/src/preprocessor.rs:466:28
|
466 | token_replacement: Option<Vec<SpannedToken<'input>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Vec<SpannedToken<'input>>>`
|
= 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)]`
Check warning on line 442 in partiql-parser/src/preprocessor.rs
github-actions / clippy
called `filter_map(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead
warning: called `filter_map(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead
--> partiql-parser/src/preprocessor.rs:439:23
|
439 | let pattern = patterns
| _______________________^
440 | | .into_iter()
441 | | .filter_map(|(args, subs)| if args.len() == 1 { Some(subs) } else { None })
442 | | .next();
| |___________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_next
= note: `#[warn(clippy::filter_map_next)]` implied by `#[warn(clippy::pedantic)]`
help: try
|
439 ~ let pattern = patterns
440 ~ .into_iter().find_map(|(args, subs)| if args.len() == 1 { Some(subs) } else { None });
|
Check warning on line 426 in partiql-parser/src/preprocessor.rs
github-actions / clippy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> partiql-parser/src/preprocessor.rs:407:29
|
407 | / ... match rest {
408 | | ... Some(substitutions) => {
409 | | ... // the identifier parsed as a nested fn_expr
410 | | ... let replacement: Vec<_> =
... |
425 | | ... }
426 | | ... }
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else
= note: `#[warn(clippy::single_match_else)]` implied by `#[warn(clippy::pedantic)]`
help: try
|
407 ~ if let Some(substitutions) = rest {
408 + // the identifier parsed as a nested fn_expr
409 + let replacement: Vec<_> =
410 + std::iter::once(first).chain(substitutions).collect();
411 + patterns = self.process_patterns(
412 + &buffered,
413 + is_nested,
414 + patterns,
415 + Some(replacement),
416 + );
417 + } else {
418 + // could not parse the identifier as a fn_expr; put back the identifier
419 + self.parser.unconsume();
420 + patterns =
421 + self.process_patterns(&buffered, is_nested, patterns, None);
422 + self.parser.consume();
423 + }
|
Check warning on line 297 in partiql-parser/src/preprocessor.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> partiql-parser/src/preprocessor.rs:297:25
|
297 | Some(Ok(_)) => match self.parser.flush_1() {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 315 in partiql-parser/src/preprocessor.rs
github-actions / clippy
unnecessary boolean `not` operation
warning: unnecessary boolean `not` operation
--> partiql-parser/src/preprocessor.rs:293:9
|
293 | / if !self.buff.is_empty() {
294 | | self.buff.pop_front()
295 | | } else {
296 | | match self.parser.consume() {
... |
314 | | }
315 | | }
| |_________^
|
= help: remove the `!` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `#[warn(clippy::if_not_else)]` implied by `#[warn(clippy::pedantic)]`