Skip to content

Commit ac43025

Browse files
committed
happy clippy
1 parent d84e9e6 commit ac43025

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

examples/wasi_ssr_module/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub async fn render() -> Result<String> {
5454
#[tokio::main(flavor = "current_thread")]
5555
async fn main() -> Result<()> {
5656
let ret = render().await?;
57-
println!("{}", ret);
57+
println!("{ret}");
5858

5959
Ok(())
6060
}

examples/web_worker_fib/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn Main() -> Html {
2929
// start the worker
3030
let output_value = fib_agent.run(input_value).await;
3131

32-
output.set(format!("Fibonacci value: {}", output_value));
32+
output.set(format!("Fibonacci value: {output_value}"));
3333
});
3434
}
3535
};

tools/build-examples/src/bin/update-wasm-opt.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ fn main() -> ExitCode {
5151

5252
if outdated_examples.is_empty() {
5353
println!(
54-
"All examples are up-to-date with the latest wasm_opt version: {}",
55-
latest_wasm_opt
54+
"All examples are up-to-date with the latest wasm_opt version: {latest_wasm_opt}"
5655
);
5756
return ExitCode::from(0);
5857
}
@@ -62,15 +61,14 @@ fn main() -> ExitCode {
6261
outdated_examples.len()
6362
);
6463
for example in &outdated_examples {
65-
println!(" - {}", example);
64+
println!(" - {example}");
6665
}
67-
println!("Latest wasm_opt version is: {}", latest_wasm_opt);
66+
println!("Latest wasm_opt version is: {latest_wasm_opt}");
6867
println!("Updating all examples...");
6968

7069
let updated_count = update_all_examples(&outdated_example_paths, &latest_wasm_opt);
7170
println!(
72-
"Updated {} example configurations to use {}",
73-
updated_count, latest_wasm_opt
71+
"Updated {updated_count} example configurations to use {latest_wasm_opt}"
7472
);
7573

7674
ExitCode::from(0)
@@ -90,8 +88,7 @@ pub fn update_all_examples(outdated_paths: &[PathBuf], latest_version: &str) ->
9088
re.replace(&content, |_: &regex::Captures| {
9189
format!(
9290
r#"[tools]
93-
wasm_opt = "{}""#,
94-
latest_version
91+
wasm_opt = "{latest_version}""#
9592
)
9693
})
9794
.to_string()
@@ -100,8 +97,7 @@ wasm_opt = "{}""#,
10097
if content.is_empty() {
10198
format!(
10299
r#"[tools]
103-
wasm_opt = "{}""#,
104-
latest_version
100+
wasm_opt = "{latest_version}""#
105101
)
106102
} else {
107103
format!(

tools/build-examples/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub fn get_latest_wasm_opt_version() -> String {
3333
.unwrap_or_else(|_| "Could not read error response".to_string());
3434

3535
panic!(
36-
"GitHub API request failed with status: {}. Details: {}",
37-
status, error_text
36+
"GitHub API request failed with status: {status}. Details: {error_text}"
3837
);
3938
}
4039

tools/build-examples/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ fn main() -> ExitCode {
5454
outdated_example_paths.push(path.clone());
5555
}
5656

57-
println!("::group::Building {}", example);
57+
println!("::group::Building {example}");
5858

5959
if !build_example(&path, &output_dir, &example) {
60-
eprintln!("::error ::{} failed to build", example);
60+
eprintln!("::error ::{example} failed to build");
6161
failure = true;
6262
}
6363

@@ -105,7 +105,7 @@ fn build_example(path: &Path, output_dir: &Path, example: &str) -> bool {
105105
.arg("--dist")
106106
.arg(&dist_dir)
107107
.arg("--public-url")
108-
.arg(format!("{}/{}", public_url_prefix, example))
108+
.arg(format!("{public_url_prefix}/{example}"))
109109
.arg("--no-sri")
110110
.status();
111111

0 commit comments

Comments
 (0)