Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ramfox committed Sep 11, 2024
1 parent 407bb49 commit 20a5c0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions iroh-net/src/discovery/local_swarm_discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ mod tests {
assert_eq!(got_ids, node_ids);
anyhow::Ok(())
};
let res = tokio::time::timeout(Duration::from_secs(5), test).await??;
Ok(res)
tokio::time::timeout(Duration::from_secs(5), test).await??;
Ok(())
}

fn make_discoverer() -> Result<(PublicKey, LocalSwarmDiscovery)> {
Expand Down
7 changes: 3 additions & 4 deletions iroh-net/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,9 @@ impl Endpoint {
.list_remote_infos()
.into_iter()
.filter(move |remote| {
remote
.sources
.iter()
.any(|(source, elapsed)| source.is_discovery() && elapsed <= &duration)
remote.sources.iter().any(|(source, elapsed)| {
matches!(source, Source::Discovery { .. }) && elapsed <= &duration
})
})
}

Expand Down
8 changes: 0 additions & 8 deletions iroh-net/src/magicsock/node_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ impl Source {
}
false
}

/// Returns true if the source is a [`Source::Discovery`]
pub fn is_discovery(&self) -> bool {
match self {
Source::Discovery { .. } => true,
_ => false,
}
}
}

impl NodeMap {
Expand Down

0 comments on commit 20a5c0c

Please sign in to comment.