Skip to content

Commit bc1853e

Browse files
authored
Merge pull request #2853 from input-output-hk/djo/rust_1.92
fix: Rust `1.92` clippy warnings
2 parents 4503402 + 32e60e1 commit bc1853e

File tree

7 files changed

+21
-25
lines changed

7 files changed

+21
-25
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/protocol-demo/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithrildemo"
3-
version = "0.1.53"
3+
version = "0.1.54"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

demo/protocol-demo/src/demonstrator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ impl Party {
128128
println!(
129129
"Party #{}: {}",
130130
self.party_id,
131-
if signature.is_some() {
132-
format!("lottery #{:?} won", signature.as_ref().unwrap().indexes)
131+
if let Some(sig) = &signature {
132+
format!("lottery #{:?} won", sig.indexes)
133133
} else {
134134
"lost all lotteries".to_string()
135135
}

mithril-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-common"
3-
version = "0.6.34"
3+
version = "0.6.35"
44
description = "Common types, interfaces, and utilities for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-common/src/test/builder/certificate_chain_builder.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -565,21 +565,17 @@ impl<'a> CertificateChainBuilder<'a> {
565565
.map(|c| c.epoch != certificate.epoch)
566566
.unwrap_or(true);
567567

568-
certificates_chained
569-
.iter()
570-
.rev()
571-
.filter(|c| {
572-
if is_certificate_first_of_epoch {
573-
// The previous certificate of the first certificate of an epoch
574-
// is the first certificate of the previous epoch
575-
c.epoch == certificate.epoch.previous().unwrap()
576-
} else {
577-
// The previous certificate of not the first certificate of an epoch
578-
// is the first certificate of the epoch
579-
c.epoch == certificate.epoch
580-
}
581-
})
582-
.next_back()
568+
certificates_chained.iter().rev().rfind(|c| {
569+
if is_certificate_first_of_epoch {
570+
// The previous certificate of the first certificate of an epoch
571+
// is the first certificate of the previous epoch
572+
c.epoch == certificate.epoch.previous().unwrap()
573+
} else {
574+
// The previous certificate of not the first certificate of an epoch
575+
// is the first certificate of the epoch
576+
c.epoch == certificate.epoch
577+
}
578+
})
583579
}
584580
CertificateChainingMethod::Sequential => certificates_chained.last(),
585581
}

mithril-test-lab/mithril-end-to-end/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-end-to-end"
3-
version = "0.4.109"
3+
version = "0.4.110"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

mithril-test-lab/mithril-end-to-end/src/utils/spec_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ macro_rules! attempt {
3030

3131
#[cfg(test)]
3232
mod tests {
33-
use crate::attempt;
34-
use crate::utils::AttemptResult;
3533
use std::time::Duration;
3634
use tokio::time::Instant;
3735

36+
use crate::utils::AttemptResult;
37+
3838
const EMPTY_RESULT: Result<Option<()>, String> = Ok(None);
3939

4040
#[tokio::test]

0 commit comments

Comments
 (0)