clippy saves the world part 3

png-branch
an 2019-03-01 23:09:18 -05:00
parent 17a882cb20
commit 4399895d08
3 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,7 @@ macro_rules! define_fixed_type {
/// Creates a value of this type with the integral portion `n`. /// Creates a value of this type with the integral portion `n`.
#[inline] #[inline]
#[allow(clippy::cast_lossless)]
pub const fn from_int(n: $LT) -> Self pub const fn from_int(n: $LT) -> Self
{ {
$Type(n as ($IT) << Self::FRACBITS) $Type(n as ($IT) << Self::FRACBITS)

View File

@ -382,7 +382,7 @@ impl ReadRleData for u16
p: &mut usize, p: &mut usize,
cmp: bool, cmp: bool,
len: usize, len: usize,
out: &mut Vec<u16>) out: &mut Vec<Self>)
{ {
if cmp { if cmp {
let d = u16b(&b[*p..*p + 2]); let d = u16b(&b[*p..*p + 2]);
@ -406,7 +406,7 @@ impl ReadRleData for u8
p: &mut usize, p: &mut usize,
cmp: bool, cmp: bool,
len: usize, len: usize,
out: &mut Vec<u8>) out: &mut Vec<Self>)
{ {
if cmp { if cmp {
let d = b[*p]; let d = b[*p];

View File

@ -114,7 +114,7 @@ pub fn read_wad(b: &[u8]) -> ResultS<Wad>
let old_wad = match ver_wad { let old_wad = match ver_wad {
Ver::Base => true, Ver::Base => true,
_ => false, _ => false,
}; };
let old_dat = ver_dat == 0; let old_dat = ver_dat == 0;