From 4807ea6be2f1c19f42981d04c0481ee6ffc2c3bc Mon Sep 17 00:00:00 2001 From: Victor Koenders Date: Sun, 17 Oct 2021 16:43:18 +0200 Subject: [PATCH] Added warning on unused lifetimes, fixed warnings --- .github/workflows/rust.yml | 2 +- src/de/decoder.rs | 4 ++-- src/de/mod.rs | 2 +- src/enc/mod.rs | 2 +- src/features/impl_std.rs | 2 +- src/lib.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8765a33..c8845b2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -134,7 +134,7 @@ "uses": "actions-rs/cargo@v1", "with": { "command": "clippy", - "args": "-- -D warnings" + "args": "--all-features -- -D warnings" }, "name": "Run `cargo clippy`" } diff --git a/src/de/decoder.rs b/src/de/decoder.rs index 7205f31..0955e19 100644 --- a/src/de/decoder.rs +++ b/src/de/decoder.rs @@ -27,7 +27,7 @@ pub struct DecoderImpl { config: C, } -impl<'de, R: Reader, C: Config> DecoderImpl { +impl DecoderImpl { /// Construct a new Decoder pub fn new(reader: R, config: C) -> DecoderImpl { DecoderImpl { reader, config } @@ -44,7 +44,7 @@ impl<'a, 'de, R: BorrowReader<'de>, C: Config> BorrowDecoder<'de> for &'a mut De } } -impl<'a, 'de, R: Reader, C: Config> Decoder for &'a mut DecoderImpl { +impl<'a, R: Reader, C: Config> Decoder for &'a mut DecoderImpl { type R = R; type C = C; diff --git a/src/de/mod.rs b/src/de/mod.rs index df709e4..cce0d0f 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -60,7 +60,7 @@ pub trait BorrowDecoder<'de>: Decoder { fn borrow_reader(&mut self) -> &mut Self::BR; } -impl<'a, 'de, T> Decoder for &'a mut T +impl<'a, T> Decoder for &'a mut T where T: Decoder, { diff --git a/src/enc/mod.rs b/src/enc/mod.rs index bc1de61..e859ffb 100644 --- a/src/enc/mod.rs +++ b/src/enc/mod.rs @@ -34,7 +34,7 @@ pub trait Encoder: sealed::Sealed { fn config(&self) -> &Self::C; } -impl<'a, 'de, T> Encoder for &'a mut T +impl<'a, T> Encoder for &'a mut T where T: Encoder, { diff --git a/src/features/impl_std.rs b/src/features/impl_std.rs index 5b9f5ca..ad58835 100644 --- a/src/features/impl_std.rs +++ b/src/features/impl_std.rs @@ -31,7 +31,7 @@ pub fn decode_from_with_config( D::decode(&mut decoder) } -impl<'storage, R: std::io::Read> Reader for R { +impl Reader for R { #[inline(always)] fn read(&mut self, bytes: &mut [u8]) -> Result<(), DecodeError> { match self.read_exact(bytes) { diff --git a/src/lib.rs b/src/lib.rs index 2461008..20ccf30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] -#![warn(missing_docs)] +#![warn(missing_docs, unused_lifetimes)] #![cfg_attr(docsrs, feature(doc_cfg))] //! Bincode is a crate for encoding and decoding using a tiny binary