Skip to content

Commit 9ec0ec8

Browse files
committed
Appease clippy
1 parent 5e9a5c2 commit 9ec0ec8

File tree

20 files changed

+75
-79
lines changed

20 files changed

+75
-79
lines changed

axoproject/src/changelog.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn try_extract_changelog_exact(
8282
changelogs: &parse_changelog::Changelog,
8383
version: &Version,
8484
) -> Option<ChangelogInfo> {
85-
let version_string = format!("{}", version);
85+
let version_string = format!("{version}");
8686

8787
changelogs
8888
.get(&*version_string)
@@ -106,7 +106,7 @@ fn try_extract_changelog_normalized(
106106
}
107107

108108
let stable_version = version.stable_part();
109-
let stable_version_string = format!("{}", stable_version);
109+
let stable_version_string = format!("{stable_version}");
110110

111111
let release_notes = changelogs.get(&*stable_version_string)?;
112112

@@ -116,7 +116,7 @@ fn try_extract_changelog_normalized(
116116
let (prefix, freeform) = raw_title.split_once(&stable_version_string)?;
117117

118118
// insert prerelease suffix into the title
119-
let title = format!("{}{}{}", prefix, version, freeform);
119+
let title = format!("{prefix}{version}{freeform}");
120120

121121
Some(ChangelogInfo {
122122
title,

axoproject/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn test_cargo_nonvirtual() {
151151

152152
{
153153
let package = get_package(&packages, "some-cdylib");
154-
assert_eq!(package.name, "some-cdylib", "packages: {:?}", packages);
154+
assert_eq!(package.name, "some-cdylib", "packages: {packages:?}");
155155
assert!(package.binaries.is_empty());
156156
}
157157

cargo-dist/src/announce.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl Display for DisabledReason {
257257
Self::DistFalse => write!(f, "dist = false"),
258258
Self::PublishFalse => write!(f, "publish = false"),
259259
Self::NoArtifacts { kinds } => write!(f, "no {}", kinds.join(" ")),
260-
Self::TagNotMatched { tag } => write!(f, "didn't match tag {}", tag),
260+
Self::TagNotMatched { tag } => write!(f, "didn't match tag {tag}"),
261261
}
262262
}
263263
}
@@ -504,7 +504,7 @@ fn select_packages(
504504
// Report each binary and potentially add it to the Release for this package
505505
let mut binaries = vec![];
506506
for binary in &pkg.binaries {
507-
info!(" {}", sty.apply_to(format!("[bin] {}", binary)));
507+
info!(" {}", sty.apply_to(format!("[bin] {binary}")));
508508
// In the future might want to allow this to be granular for each binary
509509
if disabled_reason.is_none() {
510510
binaries.push(binary.to_owned());
@@ -513,15 +513,15 @@ fn select_packages(
513513

514514
let mut cdylibs = vec![];
515515
for library in &pkg.cdylibs {
516-
info!(" {}", sty.apply_to(format!("[cdylib] {}", library)));
516+
info!(" {}", sty.apply_to(format!("[cdylib] {library}")));
517517
// In the future might want to allow this to be granular for each library
518518
if disabled_reason.is_none() {
519519
cdylibs.push(library.to_owned());
520520
}
521521
}
522522
let mut cstaticlibs = vec![];
523523
for library in &pkg.cstaticlibs {
524-
info!(" {}", sty.apply_to(format!("[cstaticlib] {}", library)));
524+
info!(" {}", sty.apply_to(format!("[cstaticlib] {library}")));
525525
// In the future might want to allow this to be granular for each library
526526
if disabled_reason.is_none() {
527527
cstaticlibs.push(library.to_owned());
@@ -910,8 +910,8 @@ pub fn announcement_github(manifest: &mut DistManifest) {
910910
if !global_installers.is_empty() {
911911
writeln!(gh_body, "## Install {heading_suffix}\n").unwrap();
912912
for (desc, hint) in global_installers {
913-
writeln!(&mut gh_body, "### {}\n", desc).unwrap();
914-
writeln!(&mut gh_body, "```sh\n{}\n```\n", hint).unwrap();
913+
writeln!(&mut gh_body, "### {desc}\n").unwrap();
914+
writeln!(&mut gh_body, "```sh\n{hint}\n```\n").unwrap();
915915
}
916916
}
917917

cargo-dist/src/backend/ci/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl GithubCiInfo {
427427
let rendered = self.generate_github_ci(dist)?;
428428

429429
LocalAsset::write_new_all(&rendered, &ci_file)?;
430-
eprintln!("generated Github CI to {}", ci_file);
430+
eprintln!("generated Github CI to {ci_file}");
431431

432432
Ok(())
433433
}

cargo-dist/src/backend/installer/homebrew.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn to_homebrew_license_format(app_license: &str) -> Result<String, ParseErro
210210
// Operations are postfix, so we pop off the previous two elements and combine.
211211
let second_operand = buffer.pop().expect("Operator missing first operand.");
212212
let first_operand = buffer.pop().expect("Operator missing second operand.");
213-
let mut combined = format!("{}, {}", first_operand, second_operand);
213+
let mut combined = format!("{first_operand}, {second_operand}");
214214

215215
// If the operations that immediately follow are the same as the current operation,
216216
// squash their operands into the same all_of/any_of clause.
@@ -220,7 +220,7 @@ pub fn to_homebrew_license_format(app_license: &str) -> Result<String, ParseErro
220220
}
221221
let _ = spdx.next();
222222
let operand = buffer.pop().expect("Operator missing first operand.");
223-
combined = format!("{}, {}", operand, combined);
223+
combined = format!("{operand}, {combined}");
224224
}
225225

226226
// Use corresponding homebrew DSL keyword and square bracket the list of licenses.

cargo-dist/src/backend/installer/msi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl MsiInstallerInfo {
111111
write_render(license)?;
112112
write_render(eula)?;
113113

114-
eprintln!("generated msi definition to {}", file);
114+
eprintln!("generated msi definition to {file}");
115115

116116
Ok(())
117117
}

cargo-dist/src/build/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ pub fn make_build_cargo_target_command(
245245
}
246246
CargoTargetPackages::Package(package) => {
247247
command.arg("--package").arg(package);
248-
eprintln!(" --package={})", package);
248+
eprintln!(" --package={package})");
249249
}
250250
}
251251

cargo-dist/src/build/generic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub fn build_generic_target(
223223
)?;
224224

225225
if !result.success() {
226-
eprintln!("Build exited non-zero: {}", result);
226+
eprintln!("Build exited non-zero: {result}");
227227
}
228228

229229
let mut expected = BuildExpectations::new(dist_graph, &target.expected_binaries);
@@ -253,7 +253,7 @@ pub fn run_extra_artifacts_build(dist: &DistGraph, build: &ExtraBuildStep) -> Di
253253
let result = run_build(dist, &build.build_command, &build.working_dir, None)?;
254254

255255
if !result.success() {
256-
eprintln!("Build exited non-zero: {}", result);
256+
eprintln!("Build exited non-zero: {result}");
257257
}
258258

259259
// Check that we got everything we expected, and copy into the distribution path

cargo-dist/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ impl std::str::FromStr for InstallPathStrategy {
504504
impl std::fmt::Display for InstallPathStrategy {
505505
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
506506
match self {
507-
InstallPathStrategy::CargoHome => write!(f, "{}", CARGO_HOME_INSTALL_PATH),
507+
InstallPathStrategy::CargoHome => write!(f, "{CARGO_HOME_INSTALL_PATH}"),
508508
InstallPathStrategy::HomeSubdir { subdir } => write!(f, "~/{subdir}"),
509509
InstallPathStrategy::EnvSubdir { env_key, subdir } => write!(f, "${env_key}/{subdir}"),
510510
}

0 commit comments

Comments
 (0)