Skip to content

Commit f8a89a8

Browse files
committed
Fixed 'mithril-stm' clippy warnings from Rust 1.67.0
1 parent 585f1f9 commit f8a89a8

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

mithril-stm/benches/multi_sig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn batch_benches(c: &mut Criterion, array_batches: &[usize], nr_sigs: usize) {
1212
let mut batch_sig = Vec::new();
1313

1414
for &nr_batches in array_batches {
15-
let batch_string = format!("Batch size: {}", nr_batches);
15+
let batch_string = format!("Batch size: {nr_batches}");
1616

1717
for _ in 0..nr_batches {
1818
let mut msg = [0u8; 32];

mithril-stm/benches/size_benches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ where
1515
H: Digest + Clone + Sync + Send + Default + FixedOutput,
1616
{
1717
println!("+-------------------+");
18-
println!("| Hash: {} |", hash_name);
18+
println!("| Hash: {hash_name} |");
1919
println!("+-------------------+");
2020
let mut rng = ChaCha20Rng::from_seed([0u8; 32]);
2121
let mut msg = [0u8; 16];

mithril-stm/benches/stm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn stm_benches<H>(c: &mut Criterion, nr_parties: usize, params: StmParameters, h
1717
where
1818
H: Clone + Debug + Digest + Send + Sync + FixedOutput + Default,
1919
{
20-
let mut group = c.benchmark_group(format!("STM/{}", hashing_alg));
20+
let mut group = c.benchmark_group(format!("STM/{hashing_alg}"));
2121
let mut rng = ChaCha20Rng::from_seed([0u8; 32]);
2222
let mut msg = [0u8; 16];
2323
rng.fill_bytes(&mut msg);
@@ -82,7 +82,7 @@ fn batch_benches<H>(
8282
) where
8383
H: Clone + Debug + Digest + FixedOutput + Send + Sync,
8484
{
85-
let mut group = c.benchmark_group(format!("STM/{}", hashing_alg));
85+
let mut group = c.benchmark_group(format!("STM/{hashing_alg}"));
8686
let mut rng = ChaCha20Rng::from_seed([0u8; 32]);
8787

8888
let param_string = format!(
@@ -91,7 +91,7 @@ fn batch_benches<H>(
9191
);
9292

9393
for &nr_batches in array_batches {
94-
let batch_string = format!("{}/batch size: {}", param_string, nr_batches);
94+
let batch_string = format!("{param_string}/batch size: {nr_batches}");
9595

9696
let mut batch_msgs = Vec::with_capacity(nr_batches);
9797
let mut batch_params = Vec::with_capacity(nr_batches);

mithril-stm/examples/key_registration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ fn main() {
115115
let msig_1 = match clerk.aggregate(&complete_sigs_1, &msg) {
116116
Ok(s) => s,
117117
Err(e) => {
118-
panic!("Aggregation failed: {:?}", e)
118+
panic!("Aggregation failed: {e:?}")
119119
}
120120
};
121121
assert!(msig_1.verify(&msg, &clerk.compute_avk(), &params).is_ok());
122122

123123
let msig_2 = match clerk.aggregate(&complete_sigs_2, &msg) {
124124
Ok(s) => s,
125125
Err(e) => {
126-
panic!("Aggregation failed: {:?}", e)
126+
panic!("Aggregation failed: {e:?}")
127127
}
128128
};
129129
assert!(msig_2.verify(&msg, &clerk.compute_avk(), &params).is_ok());

mithril-stm/src/stm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,10 +1015,10 @@ mod tests {
10151015
}
10161016

10171017
let dedup_result = clerk.dedup_sigs_for_indices(&msg, &sigs);
1018-
assert!(dedup_result.is_ok(), "dedup failure {:?}", dedup_result);
1018+
assert!(dedup_result.is_ok(), "dedup failure {dedup_result:?}");
10191019
for passed_sigs in dedup_result.unwrap() {
10201020
let verify_result = passed_sigs.verify(&params, &ps[0].vk, &ps[0].stake, &avk, &msg);
1021-
assert!(verify_result.is_ok(), "verify {:?}", verify_result);
1021+
assert!(verify_result.is_ok(), "verify {verify_result:?}");
10221022
}
10231023
}
10241024
}
@@ -1044,7 +1044,7 @@ mod tests {
10441044
match msig {
10451045
Ok(aggr) => {
10461046
let verify_result = aggr.verify(&msg, &clerk.compute_avk(), &params);
1047-
assert!(verify_result.is_ok(), "Verification failed: {:?}", verify_result);
1047+
assert!(verify_result.is_ok(), "Verification failed: {verify_result:?}");
10481048
}
10491049
Err(AggregationError::NotEnoughSignatures(n, k)) =>
10501050
assert!(n < params.k || k == params.k),

0 commit comments

Comments
 (0)