clippy lints [nfc]

This commit is contained in:
Robert Jördens 2021-07-20 21:22:06 +02:00
parent 943ab2bd6d
commit 0d6402e81a
2 changed files with 5 additions and 7 deletions

View File

@ -82,8 +82,8 @@ impl TcpSocketStorage {
}
}
impl NetStorage {
pub fn new() -> Self {
impl Default for NetStorage {
fn default() -> Self {
NetStorage {
// Placeholder for the real IP address, which is initialized at runtime.
ip_addrs: [smoltcp::wire::IpCidr::Ipv6(
@ -671,7 +671,7 @@ pub fn setup(
// Note(unwrap): The hardware configuration function is only allowed to be called once.
// Unwrapping is intended to panic if called again to prevent re-use of global memory.
let store =
cortex_m::singleton!(: NetStorage = NetStorage::new()).unwrap();
cortex_m::singleton!(: NetStorage = NetStorage::default()).unwrap();
store.ip_addrs[0] = smoltcp::wire::IpCidr::new(
smoltcp::wire::IpAddress::Ipv4(

View File

@ -74,12 +74,10 @@ impl NetworkProcessor {
// Service the network stack to process any inbound and outbound traffic.
let now = self.clock.current_ms();
let result = match self.stack.lock(|stack| stack.poll(now)) {
match self.stack.lock(|stack| stack.poll(now)) {
Ok(true) => UpdateState::Updated,
Ok(false) => UpdateState::NoChange,
Err(_) => UpdateState::Updated,
};
result
}
}
}