diff options
| author | hozan23 <hozan23@karyontech.net> | 2024-06-29 21:16:46 +0200 | 
|---|---|---|
| committer | hozan23 <hozan23@karyontech.net> | 2024-06-29 21:16:46 +0200 | 
| commit | 5c0abab1b7bf0f2858c451d6f0efc7ca0e138fc6 (patch) | |
| tree | 9d64a261ddd289560365b71f5d02d31df6c4a0ec /p2p/src/discovery/lookup.rs | |
| parent | bcc6721257889f85f57af1b40351540585ffd41d (diff) | |
use shadown variables to name clones and place them between {} when spawning new tasks
Diffstat (limited to 'p2p/src/discovery/lookup.rs')
| -rw-r--r-- | p2p/src/discovery/lookup.rs | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/p2p/src/discovery/lookup.rs b/p2p/src/discovery/lookup.rs index 8e06eef..9ddf614 100644 --- a/p2p/src/discovery/lookup.rs +++ b/p2p/src/discovery/lookup.rs @@ -283,11 +283,13 @@ impl LookupService {          let endpoint = Endpoint::Tcp(addr, self.config.discovery_port); -        let selfc = self.clone(); -        let callback = |conn: Conn<NetMsg>| async move { -            let t = Duration::from_secs(selfc.config.lookup_connection_lifespan); -            timeout(t, selfc.handle_inbound(conn)).await??; -            Ok(()) +        let callback = { +            let this = self.clone(); +            |conn: Conn<NetMsg>| async move { +                let t = Duration::from_secs(this.config.lookup_connection_lifespan); +                timeout(t, this.handle_inbound(conn)).await??; +                Ok(()) +            }          };          self.listener.start(endpoint.clone(), callback).await?; | 
