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",
"with": {
"command": "clippy",
"args": "-- -D warnings"
"args": "--all-features -- -D warnings"
},
"name": "Run `cargo clippy`"
}

View File

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

View File

@ -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,
{

View File

@ -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,
{

View File

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

View File

@ -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