Skip to content

Commit

Permalink
tidy: code touchups
Browse files Browse the repository at this point in the history
I believe these were found by clippy.
  • Loading branch information
BurntSushi committed Jan 10, 2020
1 parent 15e9281 commit 4d0764c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@ mod test {
fn prop(n: $ty_int) -> bool {
let mut buf = [0; 16];
BigEndian::$write(&mut buf, n.clone(), $bytes);
n == BigEndian::$read(&mut buf[..$bytes], $bytes)
n == BigEndian::$read(&buf[..$bytes], $bytes)
}
qc_sized(prop as fn($ty_int) -> bool, $max);
}
Expand All @@ -2471,7 +2471,7 @@ mod test {
fn prop(n: $ty_int) -> bool {
let mut buf = [0; 16];
LittleEndian::$write(&mut buf, n.clone(), $bytes);
n == LittleEndian::$read(&mut buf[..$bytes], $bytes)
n == LittleEndian::$read(&buf[..$bytes], $bytes)
}
qc_sized(prop as fn($ty_int) -> bool, $max);
}
Expand All @@ -2481,7 +2481,7 @@ mod test {
fn prop(n: $ty_int) -> bool {
let mut buf = [0; 16];
NativeEndian::$write(&mut buf, n.clone(), $bytes);
n == NativeEndian::$read(&mut buf[..$bytes], $bytes)
n == NativeEndian::$read(&buf[..$bytes], $bytes)
}
qc_sized(prop as fn($ty_int) -> bool, $max);
}
Expand All @@ -2500,7 +2500,7 @@ mod test {
let bytes = size_of::<$ty_int>();
let mut buf = [0; 16];
BigEndian::$write(&mut buf[16 - bytes..], n.clone());
n == BigEndian::$read(&mut buf[16 - bytes..])
n == BigEndian::$read(&buf[16 - bytes..])
}
qc_sized(prop as fn($ty_int) -> bool, $max - 1);
}
Expand All @@ -2511,7 +2511,7 @@ mod test {
let bytes = size_of::<$ty_int>();
let mut buf = [0; 16];
LittleEndian::$write(&mut buf[..bytes], n.clone());
n == LittleEndian::$read(&mut buf[..bytes])
n == LittleEndian::$read(&buf[..bytes])
}
qc_sized(prop as fn($ty_int) -> bool, $max - 1);
}
Expand All @@ -2522,7 +2522,7 @@ mod test {
let bytes = size_of::<$ty_int>();
let mut buf = [0; 16];
NativeEndian::$write(&mut buf[..bytes], n.clone());
n == NativeEndian::$read(&mut buf[..bytes])
n == NativeEndian::$read(&buf[..bytes])
}
qc_sized(prop as fn($ty_int) -> bool, $max - 1);
}
Expand Down Expand Up @@ -2956,7 +2956,7 @@ mod test {
fn uint_bigger_buffer() {
use {ByteOrder, LittleEndian};
let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5);
assert_eq!(n, 0x0504030201);
assert_eq!(n, 0x05_0403_0201);
}
}

Expand Down

0 comments on commit 4d0764c

Please sign in to comment.