Skip to content

Commit eef953c

Browse files
authored
Merge pull request #3226 from rbtcollins/format-and-borrows
Fix some more clippy-related issues.
2 parents b6fa995 + 39549de commit eef953c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/cli/self_update/windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ pub(crate) fn delete_rustup_and_cargo_home() -> Result<()> {
634634
// CARGO_HOME, hopefully empty except for bin/rustup.exe
635635
let cargo_home = utils::cargo_home()?;
636636
// The rustup.exe bin
637-
let rustup_path = cargo_home.join(&format!("bin/rustup{}", EXE_SUFFIX));
637+
let rustup_path = cargo_home.join(format!("bin/rustup{EXE_SUFFIX}"));
638638

639639
// The directory containing CARGO_HOME
640640
let work_path = cargo_home
@@ -644,7 +644,7 @@ pub(crate) fn delete_rustup_and_cargo_home() -> Result<()> {
644644
// Generate a unique name for the files we're about to move out
645645
// of CARGO_HOME.
646646
let numbah: u32 = rand::random();
647-
let gc_exe = work_path.join(&format!("rustup-gc-{:x}.exe", numbah));
647+
let gc_exe = work_path.join(format!("rustup-gc-{numbah:x}.exe"));
648648
// Copy rustup (probably this process's exe) to the gc exe
649649
utils::copy_file(&rustup_path, &gc_exe)?;
650650
let gc_exe_win: Vec<_> = gc_exe.as_os_str().encode_wide().chain(Some(0)).collect();
@@ -800,7 +800,7 @@ mod tests {
800800
match reg_value {
801801
Ok(_) => panic!("key not deleted"),
802802
Err(ref e) if e.kind() == io::ErrorKind::NotFound => {}
803-
Err(ref e) => panic!("error {}", e),
803+
Err(ref e) => panic!("error {e}"),
804804
}
805805
})
806806
});

src/dist/dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl TargetTriple {
300300

301301
// Default to msvc
302302
let arch = arch_primary().or_else(arch_fallback)?;
303-
let msvc_triple = format!("{}-pc-windows-msvc", arch);
303+
let msvc_triple = format!("{arch}-pc-windows-msvc");
304304
Some(TargetTriple(msvc_triple))
305305
}
306306

tests/cli-ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn rustup_ui_doc_text_tests() {
66
let rustup_init = trycmd::cargo::cargo_bin("rustup-init");
77
let rustup = trycmd::cargo::cargo_bin("rustup");
88
// Copy rustup-init to rustup so that the tests can run it.
9-
fs::copy(&rustup_init, &rustup).unwrap();
9+
fs::copy(rustup_init, &rustup).unwrap();
1010
t.register_bin("rustup", &rustup);
1111
t.case("tests/cli-ui/rustup/*.toml");
1212
#[cfg(target_os = "windows")]

tests/cli-v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ fn override_windows_root() {
403403
// This value is probably "C:"
404404
// Really sketchy to be messing with C:\ in a test...
405405
let prefix = prefix.as_os_str().to_str().unwrap();
406-
let prefix = format!("{}\\", prefix);
406+
let prefix = format!("{prefix}\\");
407407
config.change_dir(&PathBuf::from(&prefix), &|| {
408408
config.expect_ok(&["rustup", "default", "stable"]);
409409
config.expect_ok(&["rustup", "override", "add", "nightly"]);

0 commit comments

Comments
 (0)