Skip to content

Commit 7dd379c

Browse files
authored
Merge pull request #2483 from input-output-hk/djo/rust_1.87
chore: anticipate rust `1.87`
2 parents d16fd29 + 9c60eb6 commit 7dd379c

File tree

91 files changed

+188
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+188
-257
lines changed

Cargo.lock

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

examples/client-cardano-database-v2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-database-v2"
33
description = "Mithril client Cardano database example"
4-
version = "0.0.7"
4+
version = "0.0.8"
55
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-database-v2/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async fn main() -> MithrilResult<()> {
131131
)
132132
.await
133133
{
134-
println!("Could not send usage statistics to the aggregator: {:?}", e);
134+
println!("Could not send usage statistics to the aggregator: {e:?}");
135135
}
136136

137137
println!(

examples/client-cardano-database/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-database"
33
description = "Mithril client Cardano database example"
4-
version = "0.1.32"
4+
version = "0.1.33"
55
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-database/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async fn main() -> MithrilResult<()> {
8989
.await?;
9090

9191
if let Err(e) = client.cardano_database().add_statistics(&snapshot).await {
92-
println!("Could not increment snapshot download statistics: {:?}", e);
92+
println!("Could not increment snapshot download statistics: {e:?}");
9393
}
9494

9595
println!("Computing snapshot '{}' message ...", snapshot.digest);
@@ -234,7 +234,7 @@ impl FeedbackReceiver for IndicatifFeedbackReceiver {
234234
}
235235
*certificate_validation_pb = None;
236236
}
237-
_ => panic!("Unexpected event: {:?}", event),
237+
_ => panic!("Unexpected event: {event:?}"),
238238
}
239239
}
240240
}

internal/mithril-build-script/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-build-script"
3-
version = "0.2.21"
3+
version = "0.2.22"
44
description = "A toolbox for Mithril crates build scripts"
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-build-script/src/fake_aggregator.rs

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,14 @@ pub fn extract_cardano_stake_distribution_epochs(
286286
.map(|content| {
287287
let json_value: serde_json::Value =
288288
serde_json::from_str(content).unwrap_or_else(|err| {
289-
panic!(
290-
"Failed to parse JSON in csd content: {}\nError: {}",
291-
content, err
292-
);
289+
panic!("Failed to parse JSON in csd content: {content}\nError: {err}");
293290
});
294291

295292
json_value
296293
.get("epoch")
297294
.and_then(|epoch| epoch.as_u64().map(|s| s.to_string()))
298295
.unwrap_or_else(|| {
299-
panic!("Epoch not found or invalid in csd content: {}", content);
296+
panic!("Epoch not found or invalid in csd content: {content}");
300297
})
301298
})
302299
.collect()
@@ -327,33 +324,30 @@ pub fn generate_artifact_getter(
327324
artifacts_list,
328325
r###"
329326
(
330-
"{}",
331-
r#"{}"#
332-
),"###,
333-
artifact_id, file_content
327+
"{artifact_id}",
328+
r#"{file_content}"#
329+
),"###
334330
)
335331
.unwrap();
336332
}
337333

338334
format!(
339-
r###"pub(crate) fn {}() -> BTreeMap<String, String> {{
340-
[{}
335+
r###"pub(crate) fn {fun_name}() -> BTreeMap<String, String> {{
336+
[{artifacts_list}
341337
]
342338
.into_iter()
343339
.map(|(k, v)| (k.to_owned(), v.to_owned()))
344340
.collect()
345-
}}"###,
346-
fun_name, artifacts_list
341+
}}"###
347342
)
348343
}
349344

350345
/// pub(crate) fn $fun_name() -> &'static str
351346
pub fn generate_list_getter(fun_name: &str, source_json: FileContent) -> String {
352347
format!(
353-
r###"pub(crate) fn {}() -> &'static str {{
354-
r#"{}"#
355-
}}"###,
356-
fun_name, source_json
348+
r###"pub(crate) fn {fun_name}() -> &'static str {{
349+
r#"{source_json}"#
350+
}}"###
357351
)
358352
}
359353

@@ -365,8 +359,7 @@ pub fn generate_ids_array(array_name: &str, ids: BTreeSet<ArtifactId>) -> String
365359
write!(
366360
ids_list,
367361
r#"
368-
"{}","#,
369-
id
362+
"{id}","#
370363
)
371364
.unwrap();
372365
}

internal/mithril-build-script/src/open_api.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ pub fn generate_open_api_versions_mapping(open_api_spec_files: &[PathBuf]) -> St
6060
/// Build Open API versions mapping
6161
pub fn get_open_api_versions_mapping() -> HashMap<OpenAPIFileName, semver::Version> {{
6262
HashMap::from([
63-
{}
63+
{open_api_versions_hashmap}
6464
])
6565
}}
66-
"#,
67-
open_api_versions_hashmap
66+
"#
6867
)
6968
}
7069

internal/mithril-cli-helper/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-cli-helper"
3-
version = "0.0.5"
3+
version = "0.0.6"
44
description = "An internal crate to provide tools for cli."
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-cli-helper/src/source_config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ mod tests {
142142
map,
143143
&"namespace".to_string(),
144144
fake.string_value,
145-
|v: String| { format!("mapped_value from {}", v) }
145+
|v: String| { format!("mapped_value from {v}") }
146146
);
147147

148148
let expected = HashMap::from([(
@@ -200,7 +200,7 @@ mod tests {
200200
map,
201201
&"namespace".to_string(),
202202
fake.option_with_value,
203-
|v: String| format!("mapped_value from {}", v)
203+
|v: String| format!("mapped_value from {v}")
204204
);
205205
register_config_value_option!(map, &"namespace".to_string(), fake.option_none);
206206

internal/mithril-doc/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"
3-
version = "0.1.23"
3+
version = "0.1.24"
44
description = "An internal crate to generate documentation."
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-doc/src/extract_clap_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use super::{FieldDoc, StructDoc};
55
/// Extract information of an command line argument.
66
fn extract_arg(arg: &Arg) -> FieldDoc {
77
let parameter = arg.get_id().to_string();
8-
let short_option = arg.get_short().map_or("".into(), |c| format!("-{}", c));
9-
let long_option = arg.get_long().map_or("".into(), |c| format!("--{}", c));
8+
let short_option = arg.get_short().map_or("".into(), |c| format!("-{c}"));
9+
let long_option = arg.get_long().map_or("".into(), |c| format!("--{c}"));
1010
let env_variable = arg.get_env().map(|s| format!("{}", s.to_string_lossy()));
1111
let description = arg.get_help().map_or("-".into(), StyledStr::to_string);
1212
let default_value = if arg.get_default_values().iter().count() == 0 {

internal/mithril-doc/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,19 @@ pub struct GenerateDocCommands {
158158
impl GenerateDocCommands {
159159
fn save_doc(&self, cmd_name: &str, doc: &str) -> Result<(), String> {
160160
let output = if self.output.as_str() == DEFAULT_OUTPUT_FILE_TEMPLATE {
161-
format!("{}-command-line.md", cmd_name)
161+
format!("{cmd_name}-command-line.md")
162162
} else {
163163
self.output.clone()
164164
};
165165

166166
match File::create(&output) {
167167
Ok(mut buffer) => {
168-
if write!(buffer, "\n{}", doc).is_err() {
169-
return Err(format!("Error writing in {}", output));
168+
if write!(buffer, "\n{doc}").is_err() {
169+
return Err(format!("Error writing in {output}"));
170170
}
171171
println!("Documentation generated in file `{}`", &output);
172172
}
173-
_ => return Err(format!("Could not create {}", output)),
173+
_ => return Err(format!("Could not create {output}")),
174174
};
175175
Ok(())
176176
}
@@ -190,7 +190,7 @@ impl GenerateDocCommands {
190190
let cmd_name = cmd_to_document.get_name();
191191

192192
println!("Please note: the documentation generated is not able to indicate the environment variables used by the commands.");
193-
self.save_doc(cmd_name, format!("\n{}", doc).as_str())
193+
self.save_doc(cmd_name, format!("\n{doc}").as_str())
194194
}
195195
}
196196

0 commit comments

Comments
 (0)