Skip to content

Commit b3b0702

Browse files
authored
Merge pull request #2608 from input-output-hk/dlachaume/transitioning-to-rust-2024-edition
Prepare project upgrade to Rust `2024` edition
2 parents 9bc9722 + 7e3ee18 commit b3b0702

File tree

15 files changed

+286
-282
lines changed

15 files changed

+286
-282
lines changed

Cargo.lock

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

internal/cardano-node/mithril-cardano-node-chain/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-cardano-node-chain"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors.workspace = true
55
documentation.workspace = true
66
edition.workspace = true

internal/cardano-node/mithril-cardano-node-chain/src/entities/datum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ mod test {
178178

179179
fn dummy_tx_datum() -> TxDatum {
180180
let mut tx_datum_builder = TxDatumBuilder::new();
181-
let tx_datum = tx_datum_builder
181+
182+
tx_datum_builder
182183
.add_field(TxDatumFieldValue::Bytes("bytes0".to_string()))
183184
.add_field(TxDatumFieldValue::Int(0))
184185
.add_field(TxDatumFieldValue::Int(1))
@@ -187,8 +188,7 @@ mod test {
187188
.add_field(TxDatumFieldValue::Int(2))
188189
.add_field(TxDatumFieldValue::Bytes("012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789".to_string()))
189190
.build()
190-
.expect("tx_datum build should not fail");
191-
tx_datum
191+
.expect("tx_datum build should not fail")
192192
}
193193

194194
#[test]

internal/mithril-doc-derive/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-doc-derive"
3-
version = "0.1.18"
3+
version = "0.1.19"
44
description = "An internal macro to support documentation generation."
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-doc-derive/src/doc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ pub fn extract_doc_comment(attrs: &[syn::Attribute]) -> Vec<String> {
3636
})
3737
.skip_while(|s| is_blank(s))
3838
.flat_map(|s| {
39-
let lines = s
40-
.split('\n')
39+
s.split('\n')
4140
.map(|s| {
4241
// remove one leading space no matter what
4342
let s = s.strip_prefix(' ').unwrap_or(s);
4443
s.to_owned()
4544
})
46-
.collect::<Vec<_>>();
47-
lines
45+
.collect::<Vec<_>>()
4846
})
4947
.collect();
5048

internal/mithril-doc-derive/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,12 @@ fn format_field(field: &syn::Field) -> FieldInfo {
125125
_ => true,
126126
};
127127

128-
let field_info = FieldInfo {
128+
FieldInfo {
129129
name: field.ident.as_ref().unwrap().to_string(),
130130
doc,
131131
example,
132132
is_mandatory,
133-
};
134-
135-
field_info
133+
}
136134
}
137135

138136
/// To extract doc from a struct.

internal/mithril-persistence/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-persistence"
3-
version = "0.2.54"
3+
version = "0.2.55"
44
description = "Common types, interfaces, and utilities to persist data for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-persistence/src/database/version_checker.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,15 @@ mod tests {
303303

304304
fn get_table_whatever_column_count(connection: &SqliteConnection) -> i64 {
305305
let sql = "select count(*) as column_count from pragma_table_info('whatever');";
306-
let column_count = connection
306+
307+
connection
307308
.prepare(sql)
308309
.unwrap()
309310
.iter()
310311
.next()
311312
.unwrap()
312313
.unwrap()
313-
.read::<i64, _>(0);
314-
315-
column_count
314+
.read::<i64, _>(0)
316315
}
317316

318317
fn create_db_checker(connection: &ConnectionThreadSafe) -> DatabaseVersionChecker {

mithril-client-cli/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-client-cli"
3-
version = "0.12.15"
3+
version = "0.12.16"
44
description = "A Mithril Client"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-client-cli/src/commands/cardano_stake_distribution/download.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl CardanoStakeDistributionDownloadCommand {
161161
client: &Client,
162162
unique_identifier: &str,
163163
) -> MithrilResult<CardanoStakeDistribution> {
164-
let cardano_stake_distribution = if Self::is_sha256_hash(unique_identifier) {
164+
if Self::is_sha256_hash(unique_identifier) {
165165
client
166166
.cardano_stake_distribution()
167167
.get(unique_identifier)
@@ -212,9 +212,7 @@ impl CardanoStakeDistributionDownloadCommand {
212212
"No Cardano stake distribution could be found for epoch: '{}'",
213213
epoch
214214
))
215-
};
216-
217-
cardano_stake_distribution
215+
}
218216
}
219217
}
220218

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.1"
3+
version = "0.6.2"
44
description = "Common types, interfaces, and utilities for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-common/src/certificate_chain/certificate_verifier.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,8 @@ mod tests {
11041104
.to_owned()
11051105
.try_new_with_protocol_parameters(forged_protocol_parameters.clone())
11061106
.unwrap();
1107-
let signature = s_adversary.protocol_signer.sign(signed_message.as_bytes());
11081107

1109-
signature
1108+
s_adversary.protocol_signer.sign(signed_message.as_bytes())
11101109
})
11111110
.collect::<Vec<_>>();
11121111
let forged_clerk = ProtocolClerk::from_registration(

mithril-stm/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-stm"
3-
version = "0.4.5"
3+
version = "0.4.6"
44
edition = { workspace = true }
55
authors = { workspace = true }
66
homepage = { workspace = true }

mithril-stm/src/aggregate_signature/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod tests {
1919
test_runner::{RngAlgorithm::ChaCha, TestRng},
2020
};
2121
use rand_chacha::ChaCha20Rng;
22-
use rand_core::SeedableRng;
22+
use rand_core::{RngCore, SeedableRng};
2323

2424
use crate::bls_multi_signature::VerificationKey;
2525
use crate::merkle_tree::BatchPath;
@@ -39,7 +39,7 @@ mod tests {
3939
fn setup_parties(params: StmParameters, stake: Vec<Stake>) -> Vec<StmSigner<D>> {
4040
let mut kr = KeyReg::init();
4141
let mut trng = TestRng::deterministic_rng(ChaCha);
42-
let mut rng = ChaCha20Rng::from_seed(trng.gen());
42+
let mut rng = ChaCha20Rng::from_seed(trng.random());
4343

4444
#[allow(clippy::needless_collect)]
4545
let ps = stake
@@ -495,7 +495,7 @@ mod tests {
495495
stake: Vec<Stake>,
496496
) -> (Vec<StmInitializer>, Vec<(VerificationKey, Stake)>) {
497497
let mut trng = TestRng::deterministic_rng(ChaCha);
498-
let mut rng = ChaCha20Rng::from_seed(trng.gen());
498+
let mut rng = ChaCha20Rng::from_seed(trng.random());
499499

500500
let ps = stake
501501
.into_iter()

mithril-stm/src/bls_multi_signature/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mod tests {
9292
use blst::{blst_p1, blst_p2};
9393
use proptest::prelude::*;
9494
use rand_chacha::ChaCha20Rng;
95-
use rand_core::SeedableRng;
95+
use rand_core::{RngCore, SeedableRng};
9696

9797
use crate::bls_multi_signature::helper::unsafe_helpers::{p1_affine_to_sig, p2_affine_to_vk};
9898
use crate::error::{MultiSignatureError, RegisterError};

0 commit comments

Comments
 (0)