J-F-Liu / pom

PEG parser combinators using operator overloading without macros.
MIT License
500 stars 31 forks source link

`pom::utf8::end` has useless type parameter #62

Closed jendrikw closed 1 year ago

jendrikw commented 1 year ago

The compiler can't infer the type because I is literally never used. Might be a copy-paste error?

See also https://rust-lang.github.io/rust-clippy/master/index.html#/extra_unused_type_parameters

J-F-Liu commented 1 year ago

Yes, the I type parameter will be recognized as u8 by the compiler. Fixed by dc3b95f

jendrikw commented 1 year ago

Sorry to bother you, but I found the same issue for skip and list:

error: type parameter `I` goes unused in function definition
   --> src/utf8.rs:303:15
    |
303 | pub fn skip<'a, I>(n: usize) -> Parser<'a, ()> {
    |               ^^^ help: consider removing the parameter
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
note: the lint level is defined here
   --> src/lib.rs:1:9
    |
1   | #![deny(clippy::extra_unused_type_parameters)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: type parameter `I` goes unused in function definition
   --> src/utf8.rs:393:17
    |
393 | pub fn list<'a, I, O, U>(item: Parser<'a, O>, separator: Parser<'a, U>) -> Parser<'a, Vec<O>>
    |                 ^^^ help: consider removing the parameter
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

error: could not compile `pom` (lib) due to 2 previous errors
J-F-Liu commented 1 year ago

Fixed, thanks