diff --git a/src/tools/rust-installer/Cargo.toml b/src/tools/rust-installer/Cargo.toml index 060c4bf75bb..471f2b5ac73 100644 --- a/src/tools/rust-installer/Cargo.toml +++ b/src/tools/rust-installer/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Rust Project Developers"] name = "installer" version = "0.0.0" -edition = "2018" +edition = "2021" [[bin]] doc = false diff --git a/src/tools/rust-installer/src/combiner.rs b/src/tools/rust-installer/src/combiner.rs index 90816a2ec6e..19466f63fed 100644 --- a/src/tools/rust-installer/src/combiner.rs +++ b/src/tools/rust-installer/src/combiner.rs @@ -94,7 +94,7 @@ impl Combiner { let pkg_name = input_tarball.trim_end_matches(&format!(".tar.{}", compression.extension())); let pkg_name = Path::new(pkg_name).file_name().unwrap(); - let pkg_dir = Path::new(&self.work_dir).join(&pkg_name); + let pkg_dir = Path::new(&self.work_dir).join(pkg_name); // Verify the version number. let mut version = String::new(); @@ -114,9 +114,9 @@ impl Combiner { // All we need to do is copy the component directory. We could // move it, but rustbuild wants to reuse the unpacked package // dir for OS-specific installers on macOS and Windows. - let component_dir = package_dir.join(&component); + let component_dir = package_dir.join(component); create_dir(&component_dir)?; - copy_recursive(&pkg_dir.join(&component), &component_dir)?; + copy_recursive(&pkg_dir.join(component), &component_dir)?; // Merge the component name. writeln!(&components, "{}", component).context("failed to write new components")?; @@ -158,7 +158,7 @@ impl Combiner { .input(self.package_name) .output(path_to_str(&output)?.into()) .compression_profile(self.compression_profile) - .compression_formats(self.compression_formats.clone()); + .compression_formats(self.compression_formats); tarballer.run()?; Ok(()) diff --git a/src/tools/rust-installer/src/compression.rs b/src/tools/rust-installer/src/compression.rs index 7c9c946e0b5..902b2ec6907 100644 --- a/src/tools/rust-installer/src/compression.rs +++ b/src/tools/rust-installer/src/compression.rs @@ -166,7 +166,7 @@ impl Default for CompressionFormats { impl CompressionFormats { pub(crate) fn iter(&self) -> impl Iterator + '_ { - self.0.iter().map(|i| *i) + self.0.iter().copied() } } diff --git a/src/tools/rust-installer/src/generator.rs b/src/tools/rust-installer/src/generator.rs index d91a51321e4..45f8c49d03e 100644 --- a/src/tools/rust-installer/src/generator.rs +++ b/src/tools/rust-installer/src/generator.rs @@ -118,7 +118,7 @@ impl Generator { .input(self.package_name) .output(path_to_str(&output)?.into()) .compression_profile(self.compression_profile) - .compression_formats(self.compression_formats.clone()); + .compression_formats(self.compression_formats); tarballer.run()?; Ok(()) diff --git a/src/tools/rust-installer/src/scripter.rs b/src/tools/rust-installer/src/scripter.rs index 4f5130c78f4..8180f925cb0 100644 --- a/src/tools/rust-installer/src/scripter.rs +++ b/src/tools/rust-installer/src/scripter.rs @@ -2,7 +2,7 @@ use crate::util::*; use anyhow::{Context, Result}; use std::io::Write; -const TEMPLATE: &'static str = include_str!("../install-template.sh"); +const TEMPLATE: &str = include_str!("../install-template.sh"); actor! { #[derive(Debug)] diff --git a/src/tools/rust-installer/src/tarballer.rs b/src/tools/rust-installer/src/tarballer.rs index f8b48a378c9..c60d5f648ff 100644 --- a/src/tools/rust-installer/src/tarballer.rs +++ b/src/tools/rust-installer/src/tarballer.rs @@ -98,7 +98,7 @@ fn append_path(builder: &mut Builder, src: &Path, path: &String) -> if cfg!(windows) { // Windows doesn't really have a mode, so `tar` never marks files executable. // Use an extension whitelist to update files that usually should be so. - const EXECUTABLES: [&'static str; 4] = ["exe", "dll", "py", "sh"]; + const EXECUTABLES: [&str; 4] = ["exe", "dll", "py", "sh"]; if let Some(ext) = src.extension().and_then(|s| s.to_str()) { if EXECUTABLES.contains(&ext) { let mode = header.mode()?; @@ -134,7 +134,7 @@ where for entry in WalkDir::new(root.join(name)) { let entry = entry?; let path = entry.path().strip_prefix(root)?; - let path = path_to_str(&path)?; + let path = path_to_str(path)?; if entry.file_type().is_dir() { dirs.push(path.to_owned()); diff --git a/src/tools/rust-installer/src/util.rs b/src/tools/rust-installer/src/util.rs index b699aa8e8bf..4eb2e75fd7e 100644 --- a/src/tools/rust-installer/src/util.rs +++ b/src/tools/rust-installer/src/util.rs @@ -117,7 +117,7 @@ where } else { copy(entry.path(), dst)?; } - callback(&path, file_type)?; + callback(path, file_type)?; } Ok(()) }