Removed `allow` attributes, fixed some warnings

This commit is contained in:
Victor Koenders 2021-09-25 09:25:50 +02:00 committed by Victor Koenders
parent 044942891f
commit 8e99d580b8
4 changed files with 4 additions and 17 deletions

View File

@ -4,14 +4,12 @@ use crate::{
error::DecodeError,
};
pub fn decode_from<'__de, D: Decodable, R: std::io::Read>(
src: &'__de mut R,
) -> Result<D, DecodeError> {
pub fn decode_from<D: Decodable, R: std::io::Read>(src: &mut R) -> Result<D, DecodeError> {
decode_from_with_config(src, config::Default)
}
pub fn decode_from_with_config<'__de, D: Decodable, C: Config, R: std::io::Read>(
src: &'__de mut R,
pub fn decode_from_with_config<D: Decodable, C: Config, R: std::io::Read>(
src: &mut R,
_config: C,
) -> Result<D, DecodeError> {
let mut decoder = Decoder::<_, C>::new(src, _config);

View File

@ -1,8 +1,5 @@
#![allow(unused_variables)]
use crate::{config::Endian, de::read::Reader, error::DecodeError};
#[allow(dead_code)]
pub fn varint_decode_i16<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -22,7 +19,6 @@ pub fn varint_decode_i16<'a, R: Reader<'a>>(
})
}
#[allow(dead_code)]
pub fn varint_decode_i32<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -42,7 +38,6 @@ pub fn varint_decode_i32<'a, R: Reader<'a>>(
})
}
#[allow(dead_code)]
pub fn varint_decode_i64<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -62,7 +57,6 @@ pub fn varint_decode_i64<'a, R: Reader<'a>>(
})
}
#[allow(dead_code)]
pub fn varint_decode_i128<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -82,7 +76,6 @@ pub fn varint_decode_i128<'a, R: Reader<'a>>(
})
}
#[allow(dead_code)]
pub fn varint_decode_isize<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,

View File

@ -5,7 +5,6 @@ use crate::{
error::{DecodeError, IntegerType},
};
#[allow(dead_code)]
pub fn varint_decode_u16<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -37,7 +36,6 @@ pub fn varint_decode_u16<'a, R: Reader<'a>>(
}
}
#[allow(dead_code)]
pub fn varint_decode_u32<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -73,7 +71,6 @@ pub fn varint_decode_u32<'a, R: Reader<'a>>(
}
}
#[allow(dead_code)]
pub fn varint_decode_u64<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -113,7 +110,6 @@ pub fn varint_decode_u64<'a, R: Reader<'a>>(
}
}
#[allow(dead_code)]
pub fn varint_decode_usize<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,
@ -153,7 +149,6 @@ pub fn varint_decode_usize<'a, R: Reader<'a>>(
}
}
#[allow(dead_code)]
pub fn varint_decode_u128<'a, R: Reader<'a>>(
read: &mut R,
endian: Endian,

View File

@ -53,6 +53,7 @@ fn test_encodable() {
assert_eq!(&slice[..bytes_written], &[10, 10, 20]);
}
#[cfg(feature = "std")]
#[test]
fn test_decodable() {
let start = Test2 {