Skip to content

Commit

Permalink
Fix new lints in 1.77
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleiserson committed Mar 21, 2024
1 parent c6bc01c commit 0466821
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions ipa-core/src/bin/report_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,14 @@ impl KeyRegistries {
network: &NetworkConfig,
) -> Option<(KeyIdentifier, [&KeyRegistry<PublicKeyOnly>; 3])> {
// Get the configs, if all three peers have one
let Some(configs) = network.peers().iter().try_fold(Vec::new(), |acc, peer| {
let configs = network.peers().iter().try_fold(Vec::new(), |acc, peer| {
if let (mut vec, Some(hpke_config)) = (acc, peer.hpke_config.as_ref()) {
vec.push(hpke_config);
Some(vec)
} else {
None
}
}) else {
return None;
};
})?;

// Create key registries
self.0 = configs
Expand Down
4 changes: 1 addition & 3 deletions ipa-core/src/net/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,7 @@ impl ClientCertRecognizingAcceptor {
network_config: &NetworkConfig,
cert_option: Option<&Certificate>,
) -> Option<ClientIdentity> {
let Some(cert) = cert_option else {
return None;
};
let cert = cert_option?;
// We currently require an exact match with the peer cert (i.e. we don't support verifying
// the certificate against a truststore and identifying the peer by the certificate
// subject). This could be changed if the need arises.
Expand Down
4 changes: 1 addition & 3 deletions ipa-core/src/protocol/modulus_conversion/convert_shares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ where
let stream = unfold(
(ctx, locally_converted, first_record),
|(ctx, mut locally_converted, record_id)| async move {
let Some((triple, residual)) = locally_converted.next().await else {
return None;
};
let (triple, residual) = locally_converted.next().await?;
let bit_contexts = (0..).map(|i| ctx.narrow(&ConvertSharesStep::ConvertBit(i)));
let converted =
ctx.parallel_join(zip(bit_contexts, triple).map(|(ctx, triple)| async move {
Expand Down

0 comments on commit 0466821

Please sign in to comment.