Skip to content

Commit

Permalink
change edition to 2021, fix clippy warns
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Jun 21, 2023
1 parent e1c3313 commit fd1439e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/tools/rust-installer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["The Rust Project Developers"]
name = "installer"
version = "0.0.0"
edition = "2018"
edition = "2021"

[[bin]]
doc = false
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-installer/src/combiner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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")?;
Expand Down Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-installer/src/compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl Default for CompressionFormats {

impl CompressionFormats {
pub(crate) fn iter(&self) -> impl Iterator<Item = CompressionFormat> + '_ {
self.0.iter().map(|i| *i)
self.0.iter().copied()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-installer/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-installer/src/scripter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rust-installer/src/tarballer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn append_path<W: Write>(builder: &mut Builder<W>, 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()?;
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-installer/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ where
} else {
copy(entry.path(), dst)?;
}
callback(&path, file_type)?;
callback(path, file_type)?;
}
Ok(())
}
Expand Down

0 comments on commit fd1439e

Please sign in to comment.