clippy lints [nfc]
This commit is contained in:
parent
943ab2bd6d
commit
0d6402e81a
@ -82,8 +82,8 @@ impl TcpSocketStorage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NetStorage {
|
impl Default for NetStorage {
|
||||||
pub fn new() -> Self {
|
fn default() -> Self {
|
||||||
NetStorage {
|
NetStorage {
|
||||||
// Placeholder for the real IP address, which is initialized at runtime.
|
// Placeholder for the real IP address, which is initialized at runtime.
|
||||||
ip_addrs: [smoltcp::wire::IpCidr::Ipv6(
|
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.
|
// 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.
|
// Unwrapping is intended to panic if called again to prevent re-use of global memory.
|
||||||
let store =
|
let store =
|
||||||
cortex_m::singleton!(: NetStorage = NetStorage::new()).unwrap();
|
cortex_m::singleton!(: NetStorage = NetStorage::default()).unwrap();
|
||||||
|
|
||||||
store.ip_addrs[0] = smoltcp::wire::IpCidr::new(
|
store.ip_addrs[0] = smoltcp::wire::IpCidr::new(
|
||||||
smoltcp::wire::IpAddress::Ipv4(
|
smoltcp::wire::IpAddress::Ipv4(
|
||||||
|
@ -74,12 +74,10 @@ impl NetworkProcessor {
|
|||||||
// Service the network stack to process any inbound and outbound traffic.
|
// Service the network stack to process any inbound and outbound traffic.
|
||||||
let now = self.clock.current_ms();
|
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(true) => UpdateState::Updated,
|
||||||
Ok(false) => UpdateState::NoChange,
|
Ok(false) => UpdateState::NoChange,
|
||||||
Err(_) => UpdateState::Updated,
|
Err(_) => UpdateState::Updated,
|
||||||
};
|
}
|
||||||
|
|
||||||
result
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user