From 45d0a5c720cc282137f87eab7dfb4d3d5302b90c Mon Sep 17 00:00:00 2001 From: Michael Watzko Date: Wed, 10 Jun 2020 16:49:33 +0200 Subject: [PATCH] No longer allow unused --- src/lib.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f867f4c..4f59ded 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] -#![allow(unused)] #![deny(intra_doc_link_resolution_failure)] extern crate byteorder; @@ -18,8 +17,11 @@ const COMMAND_READ: u8 = 0x00 << 2; const COMMAND_WRITE: u8 = 0x01 << 2; const VARIABLE_DATA_LENGTH: u8 = 0b_00; +#[allow(unused)] const FIXED_DATA_LENGTH_1_BYTE: u8 = 0b_01; +#[allow(unused)] const FIXED_DATA_LENGTH_2_BYTES: u8 = 0b_10; +#[allow(unused)] const FIXED_DATA_LENGTH_4_BYTES: u8 = 0b_11; /// IP Address struct. Represents an IP address as a u8 array of length 4. Can be instantiated with `IpAddress::new` @@ -158,7 +160,7 @@ impl> W5500 Option { - let mask = (0x01 << socket.number()); + let mask = 0x01 << socket.number(); if self.sockets & mask == mask { self.sockets &= !mask; Some(UninitializedSocket(socket)) @@ -206,19 +208,19 @@ impl< let mut value = 0x00; if let OnWakeOnLan::InvokeInterrupt = wol { - value |= (1 << 5); + value |= 1 << 5; } if let OnPingRequest::Ignore = ping { - value |= (1 << 4); + value |= 1 << 4; } if let ConnectionType::PPoE = mode { - value |= (1 << 3); + value |= 1 << 3; } if let ArpResponses::DropAfterUse = arp { - value |= (1 << 1); + value |= 1 << 1; } self.write_to(Register::CommonRegister(0x00_00_u16), &[value]) @@ -588,7 +590,7 @@ impl> Udp w5500.write_to( socket.at(SocketRegister::TxReadPointer), &[0x00, 0x00, data_length[0], data_length[1]], - ); + )?; } w5500.write_to(