From bdb1b812135b7cb22f65009242d5b61712e8e9d7 Mon Sep 17 00:00:00 2001 From: skkeye Date: Sun, 9 Feb 2025 02:11:15 -0500 Subject: fix: nightly fmt --- examples/rp/src/bin/ethernet_w5500_icmp.rs | 25 +++++++++++++------------ examples/rp/src/bin/ethernet_w5500_icmp_ping.rs | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'examples/rp/src') diff --git a/examples/rp/src/bin/ethernet_w5500_icmp.rs b/examples/rp/src/bin/ethernet_w5500_icmp.rs index a07cdf88d..5f336b579 100644 --- a/examples/rp/src/bin/ethernet_w5500_icmp.rs +++ b/examples/rp/src/bin/ethernet_w5500_icmp.rs @@ -1,5 +1,5 @@ //! This example implements an echo (ping) with an ICMP Socket and using defmt to report the results. -//! +//! //! Although there is a better way to execute pings using the child module ping of the icmp module, //! this example allows for other icmp messages like `Destination unreachable` to be sent aswell. //! @@ -106,16 +106,12 @@ async fn main(spawner: Spawner) { // Send the packet and store the starting instant to mesure latency later let start = socket - .send_to_with( - icmp_repr.buffer_len(), - cfg.gateway.unwrap(), - |buf| { - // Create and populate the packet buffer allocated by `send_to_with` - let mut icmp_packet = Icmpv4Packet::new_unchecked(buf); - icmp_repr.emit(&mut icmp_packet, &ChecksumCapabilities::default()); - Instant::now() // Return the instant where the packet was sent - }, - ) + .send_to_with(icmp_repr.buffer_len(), cfg.gateway.unwrap(), |buf| { + // Create and populate the packet buffer allocated by `send_to_with` + let mut icmp_packet = Icmpv4Packet::new_unchecked(buf); + icmp_repr.emit(&mut icmp_packet, &ChecksumCapabilities::default()); + Instant::now() // Return the instant where the packet was sent + }) .await .unwrap(); @@ -123,7 +119,12 @@ async fn main(spawner: Spawner) { socket .recv_with(|(buf, addr)| { let packet = Icmpv4Packet::new_checked(buf).unwrap(); - info!("Recieved {:?} from {} in {}ms", packet.data(), addr, start.elapsed().as_millis()); + info!( + "Recieved {:?} from {} in {}ms", + packet.data(), + addr, + start.elapsed().as_millis() + ); }) .await .unwrap(); diff --git a/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs b/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs index 0d83e3831..0724311f9 100644 --- a/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs +++ b/examples/rp/src/bin/ethernet_w5500_icmp_ping.rs @@ -100,7 +100,7 @@ async fn main(spawner: Spawner) { // Create the ping manager instance let mut ping_manager = PingManager::new(stack, &mut rx_meta, &mut rx_buffer, &mut tx_meta, &mut tx_buffer); let addr = "192.168.8.1"; // Address to ping to - // Create the PingParams with the target address + // Create the PingParams with the target address let mut ping_params = PingParams::new(Ipv4Addr::from_str(addr).unwrap()); // (optional) Set custom properties of the ping ping_params.set_payload(b"Hello, Ping!"); // custom payload @@ -118,7 +118,7 @@ async fn main(spawner: Spawner) { Ok(time) => { info!("{} is online\n- latency: {}ms\n", ip_addr, time.as_millis()); total_online_hosts += 1; - }, + } _ => continue, } } -- cgit