From b62e3e1d47ef6d326e4b214bd7ac1e52142f2e3d Mon Sep 17 00:00:00 2001 From: Leon Camus Date: Tue, 7 Mar 2023 23:40:20 +0100 Subject: [PATCH] lint: Cargo fmt --- embassy-net/src/lib.rs | 22 ++++++++-------------- embassy-net/src/udp.rs | 13 +++++-------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index 57055bd7..05bbd07f 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs @@ -307,32 +307,26 @@ impl Stack { #[cfg(feature = "igmp")] impl Stack { pub(crate) fn join_multicast_group(&self, addr: T) -> Result - where - T: Into + where + T: Into, { let addr = addr.into(); self.with_mut(|s, i| { - s.iface.join_multicast_group( - &mut i.device, - addr, - instant_to_smoltcp(Instant::now()), - ) + s.iface + .join_multicast_group(&mut i.device, addr, instant_to_smoltcp(Instant::now())) }) } pub(crate) fn leave_multicast_group(&self, addr: T) -> Result - where - T: Into + where + T: Into, { let addr = addr.into(); self.with_mut(|s, i| { - s.iface.leave_multicast_group( - &mut i.device, - addr, - instant_to_smoltcp(Instant::now()), - ) + s.iface + .leave_multicast_group(&mut i.device, addr, instant_to_smoltcp(Instant::now())) }) } diff --git a/embassy-net/src/udp.rs b/embassy-net/src/udp.rs index c840eeaa..a8a42604 100644 --- a/embassy-net/src/udp.rs +++ b/embassy-net/src/udp.rs @@ -50,10 +50,7 @@ impl<'a, D: Driver> UdpSocket<'a, D> { udp::PacketBuffer::new(tx_meta, tx_buffer), )); - Self { - stack, - handle, - } + Self { stack, handle } } pub fn bind(&mut self, endpoint: T) -> Result<(), BindError> @@ -146,15 +143,15 @@ impl<'a, D: Driver> UdpSocket<'a, D> { #[cfg(feature = "igmp")] impl<'a, D: Driver + smoltcp::phy::Device + 'static> UdpSocket<'a, D> { pub fn join_multicast_group(&self, addr: T) -> Result - where - T: Into + where + T: Into, { self.stack.join_multicast_group(addr) } pub fn leave_multicast_group(&self, addr: T) -> Result - where - T: Into + where + T: Into, { self.stack.leave_multicast_group(addr) }