Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy for rust 1.81 #863

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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