From a417c7c8c796a359e1fe14d3e0ee82c7e14b4601 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 14 Apr 2021 10:16:47 +1000 Subject: [PATCH] Use meaningful names for select! variables --- zebra-network/src/peer_set/initialize.rs | 6 ++++-- zebrad/src/components/tokio.rs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zebra-network/src/peer_set/initialize.rs b/zebra-network/src/peer_set/initialize.rs index fef16bd6..9e6e4a6e 100644 --- a/zebra-network/src/peer_set/initialize.rs +++ b/zebra-network/src/peer_set/initialize.rs @@ -353,8 +353,10 @@ where ); let crawler_action = tokio::select! { - a = handshakes.next() => a.expect("handshakes never terminates, because it contains a future that never resolves"), - a = crawl_timer.next() => a.expect("timers never terminate"), + next_handshake_res = handshakes.next() => next_handshake_res.expect( + "handshakes never terminates, because it contains a future that never resolves" + ), + next_timer = crawl_timer.next() => next_timer.expect("timers never terminate"), // turn the demand into an action, based on the crawler's current state _ = demand_rx.next() => { if handshakes.len() > 50 { diff --git a/zebrad/src/components/tokio.rs b/zebrad/src/components/tokio.rs index 49c13c56..9bb935a1 100644 --- a/zebrad/src/components/tokio.rs +++ b/zebrad/src/components/tokio.rs @@ -73,9 +73,9 @@ mod imp { // If both signals are received, select! chooses one of them at random. tokio::select! { // SIGINT - Terminal interrupt signal. Typically generated by shells in response to Ctrl-C. - () = sig(SignalKind::interrupt(), "SIGINT") => {} + _ = sig(SignalKind::interrupt(), "SIGINT") => {} // SIGTERM - Standard shutdown signal used by process launchers. - () = sig(SignalKind::terminate(), "SIGTERM") => {} + _ = sig(SignalKind::terminate(), "SIGTERM") => {} }; }