Added warning on unused lifetimes, fixed warnings

This commit is contained in:
Victor Koenders 2021-10-17 16:43:18 +02:00
parent e232454936
commit 4807ea6be2
6 changed files with 7 additions and 7 deletions

View File

@ -134,7 +134,7 @@
"uses": "actions-rs/cargo@v1", "uses": "actions-rs/cargo@v1",
"with": { "with": {
"command": "clippy", "command": "clippy",
"args": "-- -D warnings" "args": "--all-features -- -D warnings"
}, },
"name": "Run `cargo clippy`" "name": "Run `cargo clippy`"
} }

View File

@ -27,7 +27,7 @@ pub struct DecoderImpl<R, C: Config> {
config: C, config: C,
} }
impl<'de, R: Reader, C: Config> DecoderImpl<R, C> { impl<R: Reader, C: Config> DecoderImpl<R, C> {
/// Construct a new Decoder /// Construct a new Decoder
pub fn new(reader: R, config: C) -> DecoderImpl<R, C> { pub fn new(reader: R, config: C) -> DecoderImpl<R, C> {
DecoderImpl { reader, config } 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<R, C> { impl<'a, R: Reader, C: Config> Decoder for &'a mut DecoderImpl<R, C> {
type R = R; type R = R;
type C = C; type C = C;

View File

@ -60,7 +60,7 @@ pub trait BorrowDecoder<'de>: Decoder {
fn borrow_reader(&mut self) -> &mut Self::BR; 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 where
T: Decoder, T: Decoder,
{ {

View File

@ -34,7 +34,7 @@ pub trait Encoder: sealed::Sealed {
fn config(&self) -> &Self::C; fn config(&self) -> &Self::C;
} }
impl<'a, 'de, T> Encoder for &'a mut T impl<'a, T> Encoder for &'a mut T
where where
T: Encoder, T: Encoder,
{ {

View File

@ -31,7 +31,7 @@ pub fn decode_from_with_config<D: Decode, C: Config, R: std::io::Read>(
D::decode(&mut decoder) D::decode(&mut decoder)
} }
impl<'storage, R: std::io::Read> Reader for R { impl<R: std::io::Read> Reader for R {
#[inline(always)] #[inline(always)]
fn read(&mut self, bytes: &mut [u8]) -> Result<(), DecodeError> { fn read(&mut self, bytes: &mut [u8]) -> Result<(), DecodeError> {
match self.read_exact(bytes) { match self.read_exact(bytes) {

View File

@ -1,5 +1,5 @@
#![no_std] #![no_std]
#![warn(missing_docs)] #![warn(missing_docs, unused_lifetimes)]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
//! Bincode is a crate for encoding and decoding using a tiny binary //! Bincode is a crate for encoding and decoding using a tiny binary