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

chore: fix more 1.83 lints #4750

Merged
merged 2 commits into from
Jan 13, 2025
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
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)]
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved
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
Loading