Skip to content

Commit 19213c8

Browse files
committed
Make clippy::needless-lifetimes happy
Signed-off-by: hi-rustin <[email protected]>
1 parent 3db8da6 commit 19213c8

File tree

4 files changed

+20
-34
lines changed

4 files changed

+20
-34
lines changed

src/cli/rustup_mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ pub(crate) fn cli() -> App<'static, 'static> {
747747
)
748748
}
749749

750-
fn verbose_arg<'a, 'b>(help: &'b str) -> Arg<'a, 'b> {
750+
fn verbose_arg(help: &str) -> Arg<'_, '_> {
751751
Arg::with_name("verbose")
752752
.help(help)
753753
.takes_value(false)

src/dist/component/package.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ enum DirStatus {
284284
Pending(Vec<Item>),
285285
}
286286

287-
fn unpack_without_first_dir<'a, R: Read>(
287+
fn unpack_without_first_dir<R: Read>(
288288
archive: &mut tar::Archive<R>,
289289
path: &Path,
290-
notify_handler: Option<&'a dyn Fn(Notification<'_>)>,
290+
notify_handler: Option<&dyn Fn(Notification<'_>)>,
291291
) -> Result<()> {
292292
let entries = archive.entries()?;
293293
let effective_max_ram = match effective_limits::memory_limit() {
@@ -347,10 +347,10 @@ fn unpack_without_first_dir<'a, R: Read>(
347347

348348
/// true if either no sender_entry was provided, or the incremental file
349349
/// has been fully dispatched.
350-
fn flush_ios<'a, R: std::io::Read, P: AsRef<Path>>(
350+
fn flush_ios<R: std::io::Read, P: AsRef<Path>>(
351351
io_executor: &mut dyn Executor,
352352
directories: &mut HashMap<PathBuf, DirStatus>,
353-
mut sender_entry: Option<&mut SenderEntry<'a, '_, R>>,
353+
mut sender_entry: Option<&mut SenderEntry<'_, '_, R>>,
354354
full_path: P,
355355
) -> Result<bool> {
356356
let mut result = sender_entry.is_none();

src/dist/dist.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,8 @@ pub(crate) fn valid_profile_names() -> String {
650650
// an upgrade then all the existing components will be upgraded.
651651
//
652652
// Returns the manifest's hash if anything changed.
653-
pub(crate) fn update_from_dist<'a>(
654-
download: DownloadCfg<'a>,
653+
pub(crate) fn update_from_dist(
654+
download: DownloadCfg<'_>,
655655
update_hash: Option<&Path>,
656656
toolchain: &ToolchainDesc,
657657
profile: Option<Profile>,
@@ -694,8 +694,8 @@ pub(crate) fn update_from_dist<'a>(
694694
res
695695
}
696696

697-
fn update_from_dist_<'a>(
698-
download: DownloadCfg<'a>,
697+
fn update_from_dist_(
698+
download: DownloadCfg<'_>,
699699
update_hash: Option<&Path>,
700700
toolchain: &ToolchainDesc,
701701
profile: Option<Profile>,
@@ -829,8 +829,8 @@ fn update_from_dist_<'a>(
829829
}
830830
}
831831

832-
fn try_update_from_dist_<'a>(
833-
download: DownloadCfg<'a>,
832+
fn try_update_from_dist_(
833+
download: DownloadCfg<'_>,
834834
update_hash: Option<&Path>,
835835
toolchain: &ToolchainDesc,
836836
profile: Option<Profile>,
@@ -1017,8 +1017,8 @@ fn try_update_from_dist_<'a>(
10171017
}
10181018
}
10191019

1020-
pub(crate) fn dl_v2_manifest<'a>(
1021-
download: DownloadCfg<'a>,
1020+
pub(crate) fn dl_v2_manifest(
1021+
download: DownloadCfg<'_>,
10221022
update_hash: Option<&Path>,
10231023
toolchain: &ToolchainDesc,
10241024
) -> Result<Option<(ManifestV2, String)>> {

tests/cli-self-upd.rs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ fn uninstall_deletes_bins() {
153153
let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}"));
154154
let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}"));
155155
let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}"));
156-
let rust_gdbgui = config
157-
.cargodir
158-
.join(format!("bin/rust-gdbgui{EXE_SUFFIX}"));
156+
let rust_gdbgui = config.cargodir.join(format!("bin/rust-gdbgui{EXE_SUFFIX}"));
159157
assert!(!rustup.exists());
160158
assert!(!rustc.exists());
161159
assert!(!rustdoc.exists());
@@ -175,9 +173,7 @@ fn uninstall_works_if_some_bins_dont_exist() {
175173
let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}"));
176174
let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}"));
177175
let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}"));
178-
let rust_gdbgui = config
179-
.cargodir
180-
.join(format!("bin/rust-gdbgui{EXE_SUFFIX}"));
176+
let rust_gdbgui = config.cargodir.join(format!("bin/rust-gdbgui{EXE_SUFFIX}"));
181177

182178
fs::remove_file(&rustc).unwrap();
183179
fs::remove_file(&cargo).unwrap();
@@ -255,9 +251,7 @@ fn uninstall_self_delete_works() {
255251
let cargo = config.cargodir.join(format!("bin/cargo{EXE_SUFFIX}"));
256252
let rust_lldb = config.cargodir.join(format!("bin/rust-lldb{EXE_SUFFIX}"));
257253
let rust_gdb = config.cargodir.join(format!("bin/rust-gdb{EXE_SUFFIX}"));
258-
let rust_gdbgui = config
259-
.cargodir
260-
.join(format!("bin/rust-gdbgui{EXE_SUFFIX}"));
254+
let rust_gdbgui = config.cargodir.join(format!("bin/rust-gdbgui{EXE_SUFFIX}"));
261255
assert!(!rustc.exists());
262256
assert!(!rustdoc.exists());
263257
assert!(!cargo.exists());
@@ -329,9 +323,7 @@ fn update_but_not_installed() {
329323
fn update_but_delete_existing_updater_first() {
330324
update_setup(&|config, _| {
331325
// The updater is stored in a known location
332-
let setup = config
333-
.cargodir
334-
.join(format!("bin/rustup-init{EXE_SUFFIX}"));
326+
let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}"));
335327

336328
expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]);
337329

@@ -524,9 +516,7 @@ fn updater_leaves_itself_for_later_deletion() {
524516
expect_ok(config, &["rustup", "update", "nightly"]);
525517
expect_ok(config, &["rustup", "self", "update"]);
526518

527-
let setup = config
528-
.cargodir
529-
.join(format!("bin/rustup-init{EXE_SUFFIX}"));
519+
let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}"));
530520
assert!(setup.exists());
531521
});
532522
}
@@ -540,9 +530,7 @@ fn updater_is_deleted_after_running_rustup() {
540530

541531
expect_ok(config, &["rustup", "update", "nightly"]);
542532

543-
let setup = config
544-
.cargodir
545-
.join(format!("bin/rustup-init{EXE_SUFFIX}"));
533+
let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}"));
546534
assert!(!setup.exists());
547535
});
548536
}
@@ -556,9 +544,7 @@ fn updater_is_deleted_after_running_rustc() {
556544

557545
expect_ok(config, &["rustc", "--version"]);
558546

559-
let setup = config
560-
.cargodir
561-
.join(format!("bin/rustup-init{EXE_SUFFIX}"));
547+
let setup = config.cargodir.join(format!("bin/rustup-init{EXE_SUFFIX}"));
562548
assert!(!setup.exists());
563549
});
564550
}

0 commit comments

Comments
 (0)