|
@@ -121,8 +121,8 @@ impl<'a> Parser<'a> {
|
|
|
#[cfg(feature = "ethernet")]
|
|
|
fn accept_mac_joined_with(&mut self, separator: u8) -> Result<EthernetAddress> {
|
|
|
let mut octets = [0u8; 6];
|
|
|
- for n in 0..6 {
|
|
|
- octets[n] = self.accept_number(2, 0x100, true)? as u8;
|
|
|
+ for (n, octet) in octets.iter_mut().enumerate() {
|
|
|
+ *octet = self.accept_number(2, 0x100, true)? as u8;
|
|
|
if n != 5 {
|
|
|
self.accept_char(separator)?;
|
|
|
}
|
|
@@ -270,8 +270,8 @@ impl<'a> Parser<'a> {
|
|
|
|
|
|
fn accept_ipv4_octets(&mut self) -> Result<[u8; 4]> {
|
|
|
let mut octets = [0u8; 4];
|
|
|
- for n in 0..4 {
|
|
|
- octets[n] = self.accept_number(3, 0x100, false)? as u8;
|
|
|
+ for (n, octet) in octets.iter_mut().enumerate() {
|
|
|
+ *octet = self.accept_number(3, 0x100, false)? as u8;
|
|
|
if n != 3 {
|
|
|
self.accept_char(b'.')?;
|
|
|
}
|