Skip to content

Commit

Permalink
Merge pull request #9 from Enet4/imp/lint
Browse files Browse the repository at this point in the history
Some lint fixes
  • Loading branch information
Enet4 authored Aug 2, 2021
2 parents e031478 + b7f5b51 commit f94fa7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/wrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ where
{
fn new_default(inner: T) -> Self {
ByteOrdered {
inner: inner,
inner,
endianness: Default::default(),
}
}
Expand Down Expand Up @@ -81,8 +81,8 @@ impl<T> ByteOrdered<T, Endianness> {
impl<T, E> From<(T, E)> for ByteOrdered<T, E> {
fn from((inner, endianness): (T, E)) -> Self {
ByteOrdered {
inner: inner,
endianness: endianness,
inner,
endianness,
}
}
}
Expand Down Expand Up @@ -110,8 +110,8 @@ where
/// [`runtime`]: struct.ByteOrdered.html#method.runtime
pub fn new(inner: T, endianness: E) -> Self {
ByteOrdered {
inner: inner,
endianness: endianness,
inner,
endianness,
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ fn test_macro_one_read() {
#[test]
fn test_macro_one_read_2() {
let x: &[u8] = &[16, 1];
let v = with_order!(x, Endianness::Little, |data| { data.read_u16().unwrap() });
let v = with_order!(x, Endianness::Little, |data| data.read_u16().unwrap());
assert_eq!(v, 272);

let x: &[u8] = &[1, 16];
let v = with_order!(x, Endianness::Big, |data| { data.read_u16().unwrap() });
let v = with_order!(x, Endianness::Big, |data| data.read_u16().unwrap());
assert_eq!(v, 272);
}

Expand Down

0 comments on commit f94fa7d

Please sign in to comment.