aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src/lib.rs
diff options
context:
space:
mode:
authorLeon Camus <[email protected]>2023-03-07 23:40:20 +0100
committerLeon Camus <[email protected]>2023-03-07 23:40:31 +0100
commitb62e3e1d47ef6d326e4b214bd7ac1e52142f2e3d (patch)
treefb04d472371be62d18248a2808919a4a138fc006 /embassy-net/src/lib.rs
parent468c4266c839fdb77350087b91e3ccd0aa2654be (diff)
lint: Cargo fmt
Diffstat (limited to 'embassy-net/src/lib.rs')
-rw-r--r--embassy-net/src/lib.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs
index 57055bd77..05bbd07f2 100644
--- a/embassy-net/src/lib.rs
+++ b/embassy-net/src/lib.rs
@@ -307,32 +307,26 @@ impl<D: Driver + 'static> Stack<D> {
307#[cfg(feature = "igmp")] 307#[cfg(feature = "igmp")]
308impl<D: Driver + smoltcp::phy::Device + 'static> Stack<D> { 308impl<D: Driver + smoltcp::phy::Device + 'static> Stack<D> {
309 pub(crate) fn join_multicast_group<T>(&self, addr: T) -> Result<bool, smoltcp::iface::MulticastError> 309 pub(crate) fn join_multicast_group<T>(&self, addr: T) -> Result<bool, smoltcp::iface::MulticastError>
310 where 310 where
311 T: Into<IpAddress> 311 T: Into<IpAddress>,
312 { 312 {
313 let addr = addr.into(); 313 let addr = addr.into();
314 314
315 self.with_mut(|s, i| { 315 self.with_mut(|s, i| {
316 s.iface.join_multicast_group( 316 s.iface
317 &mut i.device, 317 .join_multicast_group(&mut i.device, addr, instant_to_smoltcp(Instant::now()))
318 addr,
319 instant_to_smoltcp(Instant::now()),
320 )
321 }) 318 })
322 } 319 }
323 320
324 pub(crate) fn leave_multicast_group<T>(&self, addr: T) -> Result<bool, smoltcp::iface::MulticastError> 321 pub(crate) fn leave_multicast_group<T>(&self, addr: T) -> Result<bool, smoltcp::iface::MulticastError>
325 where 322 where
326 T: Into<IpAddress> 323 T: Into<IpAddress>,
327 { 324 {
328 let addr = addr.into(); 325 let addr = addr.into();
329 326
330 self.with_mut(|s, i| { 327 self.with_mut(|s, i| {
331 s.iface.leave_multicast_group( 328 s.iface
332 &mut i.device, 329 .leave_multicast_group(&mut i.device, addr, instant_to_smoltcp(Instant::now()))
333 addr,
334 instant_to_smoltcp(Instant::now()),
335 )
336 }) 330 })
337 } 331 }
338 332