Skip to content

Commit

Permalink
Merge pull request #1285 from input-output-hk/jpraynaud/upgrade-rust-…
Browse files Browse the repository at this point in the history
…1.73.0

Upgrade Rust `1.73.0`
  • Loading branch information
jpraynaud authored Oct 6, 2023
2 parents 79ce1da + 7604013 commit 74c8f25
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.3.108"
version = "0.3.109"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions mithril-aggregator/src/runtime/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ impl AggregatorRuntime {
) -> Result<Self, RuntimeError> {
info!("initializing runtime");

let state = if init_state.is_none() {
let state = if let Some(init_state) = init_state {
trace!("got initial state from caller");
init_state
} else {
trace!("idle state, no current beacon");
AggregatorState::Idle(IdleState {
current_beacon: None,
})
} else {
trace!("got initial state from caller");
init_state.unwrap()
};

Ok::<Self, RuntimeError>(Self {
Expand Down
2 changes: 1 addition & 1 deletion mithril-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-client"
version = "0.4.9"
version = "0.4.10"
description = "A Mithril Client"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion mithril-client/src/aggregator_client/certificate_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl CertificateClient {
let response = self.http_client.get_content(&url).await;

match response {
Err(e) if matches!(e, AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
Err(AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
Err(e) => Err(e.into()),
Ok(response) => {
let message =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl MithrilStakeDistributionClient {

Ok(Some(stake_distribution_entity))
}
Err(e) if matches!(e, AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
Err(AggregatorHTTPClientError::RemoteServerLogical(_)) => Ok(None),
Err(e) => Err(e.into()),
}
}
Expand Down
4 changes: 1 addition & 3 deletions mithril-client/src/services/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ impl SnapshotService for MithrilClientSnapshotService {
.show(&self.expand_eventual_snapshot_alias(digest).await?)
.await
.map_err(|e| match &e.downcast_ref::<AggregatorHTTPClientError>() {
Some(error)
if matches!(error, &&AggregatorHTTPClientError::RemoteServerLogical(_)) =>
{
Some(AggregatorHTTPClientError::RemoteServerLogical(_)) => {
SnapshotServiceError::SnapshotNotFound(digest.to_owned()).into()
}
_ => e,
Expand Down
2 changes: 1 addition & 1 deletion mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-common"
version = "0.2.123"
version = "0.2.124"
authors = { workspace = true }
edition = { workspace = true }
documentation = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions mithril-common/src/database/version_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ impl SqlMigration {

impl PartialOrd for SqlMigration {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.version.partial_cmp(&other.version)
Some(self.cmp(other))
}
}

impl Ord for SqlMigration {
fn cmp(&self, other: &Self) -> Ordering {
self.partial_cmp(other).unwrap()
self.version.cmp(&other.version)
}
}

Expand Down
2 changes: 1 addition & 1 deletion mithril-common/src/entities/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl PartialOrd for Certificate {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
// Order by beacon first then per hash
match self.beacon.partial_cmp(&other.beacon) {
Some(ordering) if ordering == Ordering::Equal => self.hash.partial_cmp(&other.hash),
Some(Ordering::Equal) => self.hash.partial_cmp(&other.hash),
Some(other) => Some(other),
// Beacons may be not comparable (most likely because the network isn't the same) in
// that case we can still order per hash
Expand Down
2 changes: 1 addition & 1 deletion mithril-common/src/entities/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl PartialEq for SignerWithStake {

impl PartialOrd for SignerWithStake {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.party_id.partial_cmp(&other.party_id)
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 74c8f25

Please sign in to comment.