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

0 commit comments

Comments
 (0)