Skip to content

Commit

Permalink
chore: fix more 1.83 lints (#4750)
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez authored and piotrm50 committed Jan 15, 2025
1 parent a883a80 commit c5fd100
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
6 changes: 1 addition & 5 deletions crates/iota-core/src/authority_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1216,11 +1216,7 @@ where
}

/// Records the rpc error if it is.
fn record_rpc_error_maybe(
metrics: Arc<AuthAggMetrics>,
display_name: &String,
error: &IotaError,
) {
fn record_rpc_error_maybe(metrics: Arc<AuthAggMetrics>, display_name: &str, error: &IotaError) {
if let IotaError::Rpc(_message, code) = error {
metrics
.total_rpc_err
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-core/src/authority_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ impl ValidatorService {
};
let request = request.into_inner();

let certificates = NonEmpty::from_vec(request.certificates)
.ok_or_else(|| IotaError::NoCertificateProvided)?;
let certificates =
NonEmpty::from_vec(request.certificates).ok_or(IotaError::NoCertificateProvided)?;
for certificate in &certificates {
// We need to check this first because we haven't verified the cert signature.
certificate.validity_check(epoch_store.protocol_config(), epoch_store.epoch())?;
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-core/src/safe_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ where

for object in input_objects {
let object_ref = object.compute_object_reference();
if !expected
if expected
.get(&object_ref.0)
.is_some_and(|expect| &object_ref == expect)
.is_none_or(|expect| &object_ref != expect)
{
return Err(IotaError::ByzantineAuthoritySuspicion {
authority: self.address,
Expand All @@ -395,9 +395,9 @@ where

for object in output_objects {
let object_ref = object.compute_object_reference();
if !expected
if expected
.get(&object_ref.0)
.is_some_and(|expect| &object_ref == expect)
.is_none_or(|expect| &object_ref != expect)
{
return Err(IotaError::ByzantineAuthoritySuspicion {
authority: self.address,
Expand Down
1 change: 1 addition & 0 deletions crates/iota-graphql-rpc/src/types/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ impl Page<JsonCursor<ConsistentIndexCursor>> {
/// two booleans indicating whether there is a previous or next page in
/// the range, the `checkpoint_viewed_at` to set for consistency, and an
/// iterator of cursors within that Page.
#[allow(clippy::type_complexity)]
pub(crate) fn paginate_consistent_indices(
&self,
total: usize,
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-types/src/effects/test_effects_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl TestEffectsBuilder {
}

pub fn build(self) -> TransactionEffects {
let status = self.status.unwrap_or_else(|| ExecutionStatus::Success);
let status = self.status.unwrap_or(ExecutionStatus::Success);
// TODO: This does not yet support deleted shared objects.
let shared_objects = self
.shared_input_versions
Expand Down

0 comments on commit c5fd100

Please sign in to comment.