From a27669954122c7cf816ae13abcff5fe80308be52 Mon Sep 17 00:00:00 2001 From: macpie Date: Fri, 21 Feb 2025 11:48:14 -0800 Subject: [PATCH] Fix for Rust 1.85.0 (#953) --- boost_manager/src/activator.rs | 2 +- boost_manager/src/purger.rs | 2 +- boost_manager/src/updater.rs | 2 +- boost_manager/src/watcher.rs | 2 +- file_store/src/file_info_poller.rs | 4 ++-- file_store/src/file_store.rs | 4 ++-- iot_verifier/src/gateway_updater.rs | 2 +- iot_verifier/src/runner.rs | 2 +- iot_verifier/src/witness_updater.rs | 2 +- mobile_config/src/mobile_radio_tracker.rs | 2 +- mobile_verifier/src/boosting_oracles/data_sets.rs | 2 +- mobile_verifier/src/coverage.rs | 2 +- mobile_verifier/src/data_session.rs | 2 +- mobile_verifier/src/heartbeats/cbrs.rs | 2 +- mobile_verifier/src/heartbeats/wifi.rs | 2 +- mobile_verifier/src/radio_threshold.rs | 2 +- mobile_verifier/src/rewarder.rs | 2 +- mobile_verifier/src/sp_boosted_rewards_bans.rs | 2 +- mobile_verifier/src/speedtests.rs | 2 +- mobile_verifier/src/subscriber_location.rs | 2 +- mobile_verifier/src/unique_connections/ingestor.rs | 2 +- 21 files changed, 23 insertions(+), 23 deletions(-) diff --git a/boost_manager/src/activator.rs b/boost_manager/src/activator.rs index 796a772d4..531a71fd6 100644 --- a/boost_manager/src/activator.rs +++ b/boost_manager/src/activator.rs @@ -38,7 +38,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/boost_manager/src/purger.rs b/boost_manager/src/purger.rs index 0e6c41949..9a5f545b8 100644 --- a/boost_manager/src/purger.rs +++ b/boost_manager/src/purger.rs @@ -20,7 +20,7 @@ impl ManagedTask for Purger { Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/boost_manager/src/updater.rs b/boost_manager/src/updater.rs index 1b5be1310..26e870321 100644 --- a/boost_manager/src/updater.rs +++ b/boost_manager/src/updater.rs @@ -27,7 +27,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/boost_manager/src/watcher.rs b/boost_manager/src/watcher.rs index c669cb1f2..466d53a03 100644 --- a/boost_manager/src/watcher.rs +++ b/boost_manager/src/watcher.rs @@ -34,7 +34,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/file_store/src/file_info_poller.rs b/file_store/src/file_info_poller.rs index 615ff05cd..8da3e44f7 100644 --- a/file_store/src/file_info_poller.rs +++ b/file_store/src/file_info_poller.rs @@ -556,8 +556,8 @@ mod tests { .0 .clone() .into_iter() - .filter(|file_info| after.map_or(true, |v| file_info.timestamp > v)) - .filter(|file_info| before.map_or(true, |v| file_info.timestamp <= v)) + .filter(|file_info| after.is_none_or(|v| file_info.timestamp > v)) + .filter(|file_info| before.is_none_or(|v| file_info.timestamp <= v)) .collect()) } diff --git a/file_store/src/file_store.rs b/file_store/src/file_store.rs index 68cc634be..70a1a74c7 100644 --- a/file_store/src/file_store.rs +++ b/file_store/src/file_store.rs @@ -153,8 +153,8 @@ impl FileStore { None } }) - .filter(move |info| after.map_or(true, |v| info.timestamp > v)) - .filter(move |info| before.map_or(true, |v| info.timestamp <= v)) + .filter(move |info| after.is_none_or(|v| info.timestamp > v)) + .filter(move |info| before.is_none_or(|v| info.timestamp <= v)) .map(Ok); stream::iter(filtered).boxed() } diff --git a/iot_verifier/src/gateway_updater.rs b/iot_verifier/src/gateway_updater.rs index f403a4ae2..2f02d184e 100644 --- a/iot_verifier/src/gateway_updater.rs +++ b/iot_verifier/src/gateway_updater.rs @@ -36,7 +36,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/iot_verifier/src/runner.rs b/iot_verifier/src/runner.rs index 98d0f06f6..7371e31d8 100644 --- a/iot_verifier/src/runner.rs +++ b/iot_verifier/src/runner.rs @@ -89,7 +89,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/iot_verifier/src/witness_updater.rs b/iot_verifier/src/witness_updater.rs index 661653d06..dcf9d9b0b 100644 --- a/iot_verifier/src/witness_updater.rs +++ b/iot_verifier/src/witness_updater.rs @@ -61,7 +61,7 @@ impl ManagedTask for WitnessUpdaterServer { Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_config/src/mobile_radio_tracker.rs b/mobile_config/src/mobile_radio_tracker.rs index 881503bb0..00ef36eba 100644 --- a/mobile_config/src/mobile_radio_tracker.rs +++ b/mobile_config/src/mobile_radio_tracker.rs @@ -116,7 +116,7 @@ impl ManagedTask for MobileRadioTracker { Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/boosting_oracles/data_sets.rs b/mobile_verifier/src/boosting_oracles/data_sets.rs index efb03c489..c89fd5c3b 100644 --- a/mobile_verifier/src/boosting_oracles/data_sets.rs +++ b/mobile_verifier/src/boosting_oracles/data_sets.rs @@ -267,7 +267,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/coverage.rs b/mobile_verifier/src/coverage.rs index 28b8a771f..d1dacd1b3 100644 --- a/mobile_verifier/src/coverage.rs +++ b/mobile_verifier/src/coverage.rs @@ -195,7 +195,7 @@ impl ManagedTask for CoverageDaemon { Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/data_session.rs b/mobile_verifier/src/data_session.rs index f8bc9a529..58b9d1a57 100644 --- a/mobile_verifier/src/data_session.rs +++ b/mobile_verifier/src/data_session.rs @@ -124,7 +124,7 @@ impl ManagedTask for DataSessionIngestor { Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/heartbeats/cbrs.rs b/mobile_verifier/src/heartbeats/cbrs.rs index e02010c81..6cae2d828 100644 --- a/mobile_verifier/src/heartbeats/cbrs.rs +++ b/mobile_verifier/src/heartbeats/cbrs.rs @@ -198,7 +198,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/heartbeats/wifi.rs b/mobile_verifier/src/heartbeats/wifi.rs index 9d2ed0d5f..f20ce724c 100644 --- a/mobile_verifier/src/heartbeats/wifi.rs +++ b/mobile_verifier/src/heartbeats/wifi.rs @@ -189,7 +189,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/radio_threshold.rs b/mobile_verifier/src/radio_threshold.rs index 0b9873eab..3bf710a74 100644 --- a/mobile_verifier/src/radio_threshold.rs +++ b/mobile_verifier/src/radio_threshold.rs @@ -53,7 +53,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/rewarder.rs b/mobile_verifier/src/rewarder.rs index 01de25edd..57e78e30b 100644 --- a/mobile_verifier/src/rewarder.rs +++ b/mobile_verifier/src/rewarder.rs @@ -394,7 +394,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/sp_boosted_rewards_bans.rs b/mobile_verifier/src/sp_boosted_rewards_bans.rs index e26a068e6..130a766fa 100644 --- a/mobile_verifier/src/sp_boosted_rewards_bans.rs +++ b/mobile_verifier/src/sp_boosted_rewards_bans.rs @@ -140,7 +140,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/speedtests.rs b/mobile_verifier/src/speedtests.rs index 746e98a8a..c84087e1f 100644 --- a/mobile_verifier/src/speedtests.rs +++ b/mobile_verifier/src/speedtests.rs @@ -223,7 +223,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/subscriber_location.rs b/mobile_verifier/src/subscriber_location.rs index 1e35a63b2..6dfc9fe28 100644 --- a/mobile_verifier/src/subscriber_location.rs +++ b/mobile_verifier/src/subscriber_location.rs @@ -208,7 +208,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } } diff --git a/mobile_verifier/src/unique_connections/ingestor.rs b/mobile_verifier/src/unique_connections/ingestor.rs index eb32198e5..b3affa73c 100644 --- a/mobile_verifier/src/unique_connections/ingestor.rs +++ b/mobile_verifier/src/unique_connections/ingestor.rs @@ -46,7 +46,7 @@ where Box::pin( handle .map_err(anyhow::Error::from) - .and_then(|result| async move { result.map_err(anyhow::Error::from) }), + .and_then(|result| async move { result }), ) } }