Skip to content

Commit

Permalink
Fix clippy for rust 1.81 (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie authored Sep 6, 2024
1 parent 2d6bd03 commit 8525c3c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 42 deletions.
3 changes: 1 addition & 2 deletions denylist/src/denylist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ pub fn filter_from_bin(bin: &[u8], sign_keys: &[PublicKey]) -> Result<Filter> {
let verified = sign_keys.iter().any(|pubkey| {
filter
.verify(pubkey)
.map(|res| {
.inspect(|_res| {
tracing::info!(%pubkey, "valid denylist signer");
res
})
.is_ok()
});
Expand Down
9 changes: 4 additions & 5 deletions iot_verifier/src/hex_density.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,13 @@ fn reduce_hex_res(unclipped: &mut HexMap, clipped: &mut HexMap, hex_list: Vec<Ce
hexes_at_res = hexes_at_res
.into_iter()
.unique()
.map(|parent_cell| {
let occupied_count = occupied_count(clipped, &parent_cell, density_tgt);
.inspect(|parent_cell| {
let occupied_count = occupied_count(clipped, parent_cell, density_tgt);
let limit = limit(&res, occupied_count);
if let Some(count) = unclipped.get(&parent_cell) {
if let Some(count) = unclipped.get(parent_cell) {
let actual = cmp::min(limit, *count);
clipped.insert(parent_cell, actual);
clipped.insert(*parent_cell, actual);
}
parent_cell
})
.collect()
}
Expand Down
7 changes: 2 additions & 5 deletions mobile_packet_verifier/src/accumulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,10 @@ async fn verify_known_routing_key(
authorization_verifier: &impl AuthorizationVerifier,
public_key: &PublicKeyBinary,
) -> bool {
match authorization_verifier
authorization_verifier
.verify_authorized_key(public_key, NetworkKeyRole::MobileRouter)
.await
{
Ok(res) => res,
Err(_err) => false,
}
.unwrap_or_default()
}

async fn is_duplicate(
Expand Down
8 changes: 2 additions & 6 deletions mobile_verifier/src/radio_threshold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,10 @@ where
}

async fn verify_known_carrier_key(&self, public_key: &PublicKeyBinary) -> bool {
match self
.authorization_verifier
self.authorization_verifier
.verify_authorized_key(public_key, NetworkKeyRole::MobileCarrier)
.await
{
Ok(res) => res,
Err(_err) => false,
}
.unwrap_or_default()
}

async fn verify_legacy(
Expand Down
16 changes: 4 additions & 12 deletions mobile_verifier/src/subscriber_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,25 +181,17 @@ where
}

async fn verify_known_carrier_key(&self, public_key: &PublicKeyBinary) -> bool {
match self
.authorization_verifier
self.authorization_verifier
.verify_authorized_key(public_key, NetworkKeyRole::MobileCarrier)
.await
{
Ok(res) => res,
Err(_err) => false,
}
.unwrap_or_default()
}

async fn verify_subscriber_id(&self, subscriber_id: &[u8]) -> bool {
match self
.entity_verifier
self.entity_verifier
.verify_rewardable_entity(subscriber_id)
.await
{
Ok(res) => res,
Err(_err) => false,
}
.unwrap_or_default()
}
}

Expand Down
16 changes: 4 additions & 12 deletions mobile_verifier/src/subscriber_verified_mapping_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,25 +189,17 @@ where
}

async fn verify_known_carrier_key(&self, public_key: &PublicKeyBinary) -> bool {
match self
.authorization_verifier
self.authorization_verifier
.verify_authorized_key(public_key, NetworkKeyRole::MobileCarrier)
.await
{
Ok(res) => res,
Err(_err) => false,
}
.unwrap_or_default()
}

async fn verify_subscriber_id(&self, subscriber_id: &[u8]) -> bool {
match self
.entity_verifier
self.entity_verifier
.verify_rewardable_entity(subscriber_id)
.await
{
Ok(res) => res,
Err(_err) => false,
}
.unwrap_or_default()
}
}

Expand Down

0 comments on commit 8525c3c

Please sign in to comment.