Fix code syle nits

- phy: Fix unused mut ref
 - wire: Fix comment collapse unneeded impl block

Closes: #250
Approved by: whitequark
This commit is contained in:
Dan Robertson 2018-06-26 12:23:21 +00:00 committed by Homu
parent 1745df2110
commit 56463f19bd
3 changed files with 4 additions and 5 deletions

View File

@ -95,7 +95,7 @@ impl phy::TxToken for TxToken {
let mut lower = self.lower.borrow_mut();
let mut buffer = vec![0; len];
let result = f(&mut buffer);
lower.send(&mut buffer[..]).unwrap();
lower.send(&buffer[..]).unwrap();
result
}
}

View File

@ -98,7 +98,7 @@ impl phy::TxToken for TxToken {
let mut lower = self.lower.borrow_mut();
let mut buffer = vec![0; len];
let result = f(&mut buffer);
lower.send(&mut buffer[..]).unwrap();
lower.send(&buffer[..]).unwrap();
result
}
}

View File

@ -307,9 +307,7 @@ impl<'a> Ipv6OptionsIterator<'a> {
length, data
}
}
}
impl<'a> Ipv6OptionsIterator<'a> {
/// Helper function to return an error in the implementation
/// of `Iterator`.
#[inline]
@ -343,7 +341,8 @@ impl<'a> Iterator for Ipv6OptionsIterator<'a> {
}
}
} else {
// If we failed to parse an option we do
// If we failed to parse a previous option or hit the end of the
// buffer, we do not continue to iterate.
None
}
}