diff options
| author | Yuri Astrakhan <YuriAstrakhan@gmail.com> | 2022-12-23 13:42:58 -0500 |
|---|---|---|
| committer | Yuri Astrakhan <YuriAstrakhan@gmail.com> | 2022-12-24 14:36:10 -0500 |
| commit | e16c76e3c30fd1123921e33f408d99b5cb40532f (patch) | |
| tree | 7baaed532b19918ed80b8e6d91baed4610411713 /xtask | |
| parent | 1927c2e1d8d222656cae7051cdd924aa44428622 (diff) | |
Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.
The change was automatically created with, so there are far less change
of an accidental typo.
```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
Diffstat (limited to 'xtask')
| -rw-r--r-- | xtask/src/dist.rs | 14 | ||||
| -rw-r--r-- | xtask/src/metrics.rs | 2 | ||||
| -rw-r--r-- | xtask/src/release.rs | 2 | ||||
| -rw-r--r-- | xtask/src/release/changelog.rs | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs index 686aec4ae50..410276bc45b 100644 --- a/xtask/src/dist.rs +++ b/xtask/src/dist.rs @@ -26,10 +26,10 @@ impl flags::Dist { if let Some(patch_version) = self.client_patch_version { let version = if stable { - format!("{}.{}", VERSION_STABLE, patch_version) + format!("{VERSION_STABLE}.{patch_version}") } else { // A hack to make VS Code prefer nightly over stable. - format!("{}.{}", VERSION_NIGHTLY, patch_version) + format!("{VERSION_NIGHTLY}.{patch_version}") }; dist_server(sh, &format!("{version}-standalone"), &target)?; let release_tag = if stable { date_iso(sh)? } else { "nightly".to_string() }; @@ -59,10 +59,10 @@ fn dist_client( let mut patch = Patch::new(sh, "./package.json")?; patch .replace( - &format!(r#""version": "{}.0-dev""#, VERSION_DEV), - &format!(r#""version": "{}""#, version), + &format!(r#""version": "{VERSION_DEV}.0-dev""#), + &format!(r#""version": "{version}""#), ) - .replace(r#""releaseTag": null"#, &format!(r#""releaseTag": "{}""#, release_tag)) + .replace(r#""releaseTag": null"#, &format!(r#""releaseTag": "{release_tag}""#)) .replace(r#""$generated-start": {},"#, "") .replace(",\n \"$generated-end\": {}", "") .replace(r#""enabledApiProposals": [],"#, r#""#); @@ -130,8 +130,8 @@ impl Target { } else { (String::new(), None) }; - let server_path = out_path.join(format!("rust-analyzer{}", exe_suffix)); - let artifact_name = format!("rust-analyzer-{}{}", name, exe_suffix); + let server_path = out_path.join(format!("rust-analyzer{exe_suffix}")); + let artifact_name = format!("rust-analyzer-{name}{exe_suffix}"); Self { name, server_path, symbols_path, artifact_name } } } diff --git a/xtask/src/metrics.rs b/xtask/src/metrics.rs index ebeb873463e..b6f730dbf12 100644 --- a/xtask/src/metrics.rs +++ b/xtask/src/metrics.rs @@ -87,7 +87,7 @@ impl Metrics { self.measure_analysis_stats_path( sh, bench, - &format!("./target/rustc-perf/collector/benchmarks/{}", bench), + &format!("./target/rustc-perf/collector/benchmarks/{bench}"), ) } fn measure_analysis_stats_path( diff --git a/xtask/src/release.rs b/xtask/src/release.rs index eda8fceef05..bfbe9556964 100644 --- a/xtask/src/release.rs +++ b/xtask/src/release.rs @@ -64,7 +64,7 @@ impl flags::Release { let prev_tag = tags.lines().filter(|line| is_release_tag(line)).last().unwrap(); let contents = changelog::get_changelog(sh, changelog_n, &commit, prev_tag, &today)?; - let path = changelog_dir.join(format!("{}-changelog-{}.adoc", today, changelog_n)); + let path = changelog_dir.join(format!("{today}-changelog-{changelog_n}.adoc")); sh.write_file(&path, &contents)?; Ok(()) diff --git a/xtask/src/release/changelog.rs b/xtask/src/release/changelog.rs index 7df8f89dbe2..4a06bb9ac08 100644 --- a/xtask/src/release/changelog.rs +++ b/xtask/src/release/changelog.rs @@ -25,7 +25,7 @@ pub(crate) fn get_changelog( let line = line.trim_start(); if let Some(pr_num) = parse_pr_number(&line) { let accept = "Accept: application/vnd.github.v3+json"; - let authorization = format!("Authorization: token {}", token); + let authorization = format!("Authorization: token {token}"); let pr_url = "https://api.github.com/repos/rust-lang/rust-analyzer/issues"; // we don't use an HTTPS client or JSON parser to keep the build times low @@ -57,7 +57,7 @@ pub(crate) fn get_changelog( PrKind::Other => &mut others, PrKind::Skip => continue, }; - writeln!(s, "* pr:{}[] {}", pr_num, l.message.as_deref().unwrap_or(&pr_title)).unwrap(); + writeln!(s, "* pr:{pr_num}[] {}", l.message.as_deref().unwrap_or(&pr_title)).unwrap(); } } |
