rust-pcap / pcap

Rust language pcap library
Apache License 2.0
610 stars 138 forks source link

Clippy complains #157

Closed stappersg closed 3 years ago

stappersg commented 3 years ago

Hi,

clippy-driver  rustc --crate-name pcap --edition=2018 src/lib.rs

reports errors.

Probably a known issue, but now there is an issue about it.

stappersg commented 3 years ago

Complain from clippy as found for #156

 error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
  --> src/stream.rs:47:5
   |
47 |     fn decode<'a>(&mut self, packet: Packet<'a>) -> Result<Self::Type, Error>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

In my rustup environment I get complians from clippy about libc, but nothing about lifetimes ...

sekineh commented 3 years ago

stable = 1.48 OK https://github.com/ebfull/pcap/actions/runs/453647534

stable = 1.49 Fails https://github.com/ebfull/pcap/actions/runs/455364191

Wojtek242 commented 3 years ago

Fixed in #159