Skip to content

Commit 28d4b1b

Browse files
committed
Fix warnings with Rust '1.73.0'
1 parent 79ce1da commit 28d4b1b

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

mithril-aggregator/src/runtime/state_machine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ impl AggregatorRuntime {
7575
) -> Result<Self, RuntimeError> {
7676
info!("initializing runtime");
7777

78-
let state = if init_state.is_none() {
78+
let state = if let Some(init_state) = init_state {
79+
trace!("got initial state from caller");
80+
init_state
81+
} else {
7982
trace!("idle state, no current beacon");
8083
AggregatorState::Idle(IdleState {
8184
current_beacon: None,
8285
})
83-
} else {
84-
trace!("got initial state from caller");
85-
init_state.unwrap()
8686
};
8787

8888
Ok::<Self, RuntimeError>(Self {

mithril-client/src/aggregator_client/certificate_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl CertificateClient {
3232
let response = self.http_client.get_content(&url).await;
3333

3434
match response {
35-
Err(e) if matches!(e, AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
35+
Err(AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
3636
Err(e) => Err(e.into()),
3737
Ok(response) => {
3838
let message =

mithril-client/src/aggregator_client/mithril_stake_distribution_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl MithrilStakeDistributionClient {
5050

5151
Ok(Some(stake_distribution_entity))
5252
}
53-
Err(e) if matches!(e, AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
53+
Err(AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
5454
Err(e) => Err(e.into()),
5555
}
5656
}

mithril-client/src/services/snapshot.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ impl SnapshotService for MithrilClientSnapshotService {
194194
.show(&self.expand_eventual_snapshot_alias(digest).await?)
195195
.await
196196
.map_err(|e| match &e.downcast_ref::<AggregatorHTTPClientError>() {
197-
Some(error)
198-
if matches!(error, &&AggregatorHTTPClientError::RemoteServerLogical(_)) =>
199-
{
197+
Some(AggregatorHTTPClientError::RemoteServerLogical(_)) => {
200198
SnapshotServiceError::SnapshotNotFound(digest.to_owned()).into()
201199
}
202200
_ => e,

mithril-common/src/database/version_checker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl SqlMigration {
154154

155155
impl PartialOrd for SqlMigration {
156156
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
157-
self.version.partial_cmp(&other.version)
157+
Some(self.version.cmp(&other.version))
158158
}
159159
}
160160

mithril-common/src/entities/certificate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl PartialOrd for Certificate {
130130
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
131131
// Order by beacon first then per hash
132132
match self.beacon.partial_cmp(&other.beacon) {
133-
Some(ordering) if ordering == Ordering::Equal => self.hash.partial_cmp(&other.hash),
133+
Some(Ordering::Equal) => self.hash.partial_cmp(&other.hash),
134134
Some(other) => Some(other),
135135
// Beacons may be not comparable (most likely because the network isn't the same) in
136136
// that case we can still order per hash

mithril-common/src/entities/signer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl PartialEq for SignerWithStake {
152152

153153
impl PartialOrd for SignerWithStake {
154154
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
155-
self.party_id.partial_cmp(&other.party_id)
155+
Some(self.party_id.cmp(&other.party_id))
156156
}
157157
}
158158

0 commit comments

Comments
 (0)