some fixes #68
clippy
9 errors, 9 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 9 |
Warning | 9 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.64.0 (a55dd71d5 2022-09-19)
- cargo 1.64.0 (387270bc7 2022-09-16)
- clippy 0.1.64 (a55dd71 2022-09-19)
Annotations
Check failure on line 236 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
mismatched types
error[E0308]: mismatched types
--> src/parser/parse_from_text/link_element.rs:235:5
|
234 | fn take_while_ipchar(input: &str) -> IResult<&str, &str> {
| ------------------- expected `std::result::Result<(&str, &str), nom::Err<nom::error::Error<&str>>>` because of return type
235 | / many0(alt((take_while(is_ipchar_not_pct_encoded), take_while(is_pct_encoded)))(input)
236 | | }
| |_^ expected enum `std::result::Result`, found opaque type
|
::: /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-7.1.3/src/multi/mod.rs:53:39
|
53 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
| -------------------------------------- the found opaque type
|
= note: expected enum `std::result::Result<(&str, &str), nom::Err<nom::error::Error<&str>>>`
found opaque type `impl FnMut(_) -> std::result::Result<(_, std::vec::Vec<_>), nom::Err<_>>`
Check failure on line 235 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
expected a `std::ops::FnMut<(_,)>` closure, found `std::result::Result<(&str, &str), nom::Err<_>>`
error[E0277]: expected a `std::ops::FnMut<(_,)>` closure, found `std::result::Result<(&str, &str), nom::Err<_>>`
--> src/parser/parse_from_text/link_element.rs:235:11
|
235 | many0(alt((take_while(is_ipchar_not_pct_encoded), take_while(is_pct_encoded)))(input)
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut<(_,)>` closure, found `std::result::Result<(&str, &str), nom::Err<_>>`
| |
| required by a bound introduced by this call
|
= help: the trait `std::ops::FnMut<(_,)>` is not implemented for `std::result::Result<(&str, &str), nom::Err<_>>`
= help: the following other types implement trait `nom::Parser<I, O, E>`:
<nom::And<F, G> as nom::Parser<I, (O1, O2), E>>
<nom::AndThen<F, G, O1> as nom::Parser<I, O2, E>>
<nom::FlatMap<F, G, O1> as nom::Parser<I, O2, E>>
<nom::Into<F, O1, O2, E1, E2> as nom::Parser<I, O2, E2>>
<nom::Map<F, G, O1> as nom::Parser<I, O2, E>>
<nom::Or<F, G> as nom::Parser<I, O, E>>
<std::boxed::Box<(dyn nom::Parser<I, O, E> + 'a)> as nom::Parser<I, O, E>>
= note: required because of the requirements on the impl of `nom::Parser<_, _, _>` for `std::result::Result<(&str, &str), nom::Err<_>>`
note: required by a bound in `nom::multi::many0`
--> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-7.1.3/src/multi/mod.rs:56:6
|
56 | F: Parser<I, O, E>,
| ^^^^^^^^^^^^^^^ required by this bound in `nom::multi::many0`
Check failure on line 235 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
type mismatch resolving `<&str as nom::InputTakeAtPosition>::Item == [char; 3]`
error[E0271]: type mismatch resolving `<&str as nom::InputTakeAtPosition>::Item == [char; 3]`
--> src/parser/parse_from_text/link_element.rs:235:55
|
235 | many0(alt((take_while(is_ipchar_not_pct_encoded), take_while(is_pct_encoded)))(input)
| ^^^^^^^^^^ expected `char`, found array `[char; 3]`
Check failure on line 199 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
mismatched types
error[E0308]: mismatched types
--> src/parser/parse_from_text/link_element.rs:199:41
|
199 | is_iunreserved(c) || is_pct_encoded(c) || is_sub_delim(c)
| -------------- ^ expected array `[char; 3]`, found `char`
| |
| arguments to this function are incorrect
|
note: function defined here
--> src/parser/parse_from_text/link_element.rs:238:4
|
238 | fn is_pct_encoded(c: [char; 3]) -> bool {
| ^^^^^^^^^^^^^^ ------------
Check failure on line 92 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
mismatched types
error[E0308]: mismatched types
--> src/parser/parse_from_text/link_element.rs:92:41
|
92 | is_iunreserved(c) || is_pct_encoded(c) || is_sub_delim(c)
| -------------- ^ expected array `[char; 3]`, found `char`
| |
| arguments to this function are incorrect
|
note: function defined here
--> src/parser/parse_from_text/link_element.rs:238:4
|
238 | fn is_pct_encoded(c: [char; 3]) -> bool {
| ^^^^^^^^^^^^^^ ------------
Check warning on line 293 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
redundant field names in struct initialization
warning: redundant field names in struct initialization
--> src/parser/parse_from_text/link_element.rs:293:17
|
293 | scheme: scheme,
| ^^^^^^^^^^^^^^ help: replace it with: `scheme`
|
= note: `#[warn(clippy::redundant_field_names)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
Check warning on line 5 in src/parser/parse_from_text/text_elements.rs
github-actions / clippy
unused import: `super::base_parsers::*`
warning: unused import: `super::base_parsers::*`
--> src/parser/parse_from_text/text_elements.rs:5:5
|
5 | use super::base_parsers::*;
| ^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 2 in src/parser/parse_from_text/text_elements.rs
github-actions / clippy
unused import: `crate::parser::link_url::LinkDestination`
warning: unused import: `crate::parser::link_url::LinkDestination`
--> src/parser/parse_from_text/text_elements.rs:2:5
|
2 | use crate::parser::link_url::LinkDestination;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 8 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
unused imports: `peek`, `take`, `verify`
warning: unused imports: `peek`, `take`, `verify`
--> src/parser/parse_from_text/link_element.rs:8:28
|
8 | bytes::complete::{tag, take, take_while, take_while1, take_while_m_n},
| ^^^^
9 | character::complete::{char, u8},
10 | combinator::{opt, peek, recognize, verify},
| ^^^^ ^^^^^^
Check warning on line 4 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
unused imports: `Offset`, `Slice`
warning: unused imports: `Offset`, `Slice`
--> src/parser/parse_from_text/link_element.rs:4:18
|
4 | use crate::nom::{Offset, Slice};
| ^^^^^^ ^^^^^
Check warning on line 1 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
unused import: `super::base_parsers::*`
warning: unused import: `super::base_parsers::*`
--> src/parser/parse_from_text/link_element.rs:1:5
|
1 | use super::base_parsers::*;
| ^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 6 in src/parser/parse_from_text/desktop_subset.rs
github-actions / clippy
unused imports: `direct_delimited`, `is_white_space_but_not_linebreak`, `is_white_space`
warning: unused imports: `direct_delimited`, `is_white_space_but_not_linebreak`, `is_white_space`
--> src/parser/parse_from_text/desktop_subset.rs:6:5
|
6 | direct_delimited, is_white_space, is_white_space_but_not_linebreak, CustomError,
| ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 4 in src/parser/parse_from_text/desktop_subset.rs
github-actions / clippy
unused import: `super::base_parsers::*`
warning: unused import: `super::base_parsers::*`
--> src/parser/parse_from_text/desktop_subset.rs:4:5
|
4 | use super::base_parsers::*;
| ^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 6 in src/parser/parse_from_text/base_parsers.rs
github-actions / clippy
unused import: `Error`
warning: unused import: `Error`
--> src/parser/parse_from_text/base_parsers.rs:6:13
|
6 | error::{Error, ErrorKind, ParseError},
| ^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Check failure on line 258 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
cannot find function `is_ipchar` in this scope
error[E0425]: cannot find function `is_ipchar` in this scope
--> src/parser/parse_from_text/link_element.rs:258:5
|
52 | fn is_ucschar(c: char) -> bool {
| ------------------------------ similarly named function `is_ucschar` defined here
...
258 | is_ipchar(c) || matches!(c, '/' | '?')
| ^^^^^^^^^ help: a function with a similar name exists: `is_ucschar`
Check failure on line 223 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
cannot find value `is_ipchar` in this scope
error[E0425]: cannot find value `is_ipchar` in this scope
--> src/parser/parse_from_text/link_element.rs:223:48
|
52 | fn is_ucschar(c: char) -> bool {
| ------------------------------ similarly named function `is_ucschar` defined here
...
223 | many0(tuple((char('/'), take_while(is_ipchar)))),
| ^^^^^^^^^ help: a function with a similar name exists: `is_ucschar`
Check failure on line 218 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
cannot find value `is_ipchar` in this scope
error[E0425]: cannot find value `is_ipchar` in this scope
--> src/parser/parse_from_text/link_element.rs:218:52
|
52 | fn is_ucschar(c: char) -> bool {
| ------------------------------ similarly named function `is_ucschar` defined here
...
218 | many0(tuple((char('/'), take_while(is_ipchar)))),
| ^^^^^^^^^ help: a function with a similar name exists: `is_ucschar`
Check failure on line 217 in src/parser/parse_from_text/link_element.rs
github-actions / clippy
cannot find value `is_ipchar` in this scope
error[E0425]: cannot find value `is_ipchar` in this scope
--> src/parser/parse_from_text/link_element.rs:217:29
|
52 | fn is_ucschar(c: char) -> bool {
| ------------------------------ similarly named function `is_ucschar` defined here
...
217 | take_while1(is_ipchar),
| ^^^^^^^^^ help: a function with a similar name exists: `is_ucschar`