about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2023-09-13 18:12:41 +0200
committerJakub Beránek <berykubik@gmail.com>2023-09-13 18:12:41 +0200
commitf13b54546bb7aea9beee7d3f9178882a7f10f45c (patch)
tree4bf37d822e75d6e306eb8702e81ed53c9dbfa95f /src/tools
parent6c718b5b8a98ba756c69e8a2019131c6a514e64d (diff)
downloadrust-f13b54546bb7aea9beee7d3f9178882a7f10f45c.tar.gz
rust-f13b54546bb7aea9beee7d3f9178882a7f10f45c.zip
Resolve clippy warnings
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/opt-dist/src/tests.rs6
-rw-r--r--src/tools/opt-dist/src/training.rs2
-rw-r--r--src/tools/opt-dist/src/utils/io.rs6
3 files changed, 6 insertions, 8 deletions
diff --git a/src/tools/opt-dist/src/tests.rs b/src/tools/opt-dist/src/tests.rs
index 54f7185f88a..31aabca09f3 100644
--- a/src/tools/opt-dist/src/tests.rs
+++ b/src/tools/opt-dist/src/tests.rs
@@ -33,8 +33,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
 
     // We need to manually copy libstd to the extracted rustc sysroot
     copy_directory(
-        &libstd_dir.join("lib").join("rustlib").join(&host_triple).join("lib"),
-        &rustc_dir.join("lib").join("rustlib").join(&host_triple).join("lib"),
+        &libstd_dir.join("lib").join("rustlib").join(host_triple).join("lib"),
+        &rustc_dir.join("lib").join("rustlib").join(host_triple).join("lib"),
     )?;
 
     // Extract sources - they aren't in the `rustc-nightly-{host}` tarball, so we need to manually copy libstd
@@ -109,6 +109,6 @@ fn find_dist_version(directory: &Utf8Path) -> anyhow::Result<String> {
         .unwrap()
         .to_string();
     let (version, _) =
-        archive.strip_prefix("reproducible-artifacts-").unwrap().split_once("-").unwrap();
+        archive.strip_prefix("reproducible-artifacts-").unwrap().split_once('-').unwrap();
     Ok(version.to_string())
 }
diff --git a/src/tools/opt-dist/src/training.rs b/src/tools/opt-dist/src/training.rs
index dd8aa532408..274f4cea0ab 100644
--- a/src/tools/opt-dist/src/training.rs
+++ b/src/tools/opt-dist/src/training.rs
@@ -192,7 +192,7 @@ pub fn gather_llvm_bolt_profiles(env: &Environment) -> anyhow::Result<LlvmBoltPr
     log::info!("Merging LLVM BOLT profiles to {merged_profile}");
 
     let profiles: Vec<_> =
-        glob::glob(&format!("{profile_root}*"))?.into_iter().collect::<Result<Vec<_>, _>>()?;
+        glob::glob(&format!("{profile_root}*"))?.collect::<Result<Vec<_>, _>>()?;
 
     let mut merge_args = vec!["merge-fdata"];
     merge_args.extend(profiles.iter().map(|p| p.to_str().unwrap()));
diff --git a/src/tools/opt-dist/src/utils/io.rs b/src/tools/opt-dist/src/utils/io.rs
index d24a1dc2d10..d6bd5cb85e4 100644
--- a/src/tools/opt-dist/src/utils/io.rs
+++ b/src/tools/opt-dist/src/utils/io.rs
@@ -63,7 +63,6 @@ pub fn get_files_from_dir(
     let path = format!("{dir}/*{}", suffix.unwrap_or(""));
 
     Ok(glob::glob(&path)?
-        .into_iter()
         .map(|p| p.map(|p| Utf8PathBuf::from_path_buf(p).unwrap()))
         .collect::<Result<Vec<_>, _>>()?)
 }
@@ -74,9 +73,8 @@ pub fn find_file_in_dir(
     prefix: &str,
     suffix: &str,
 ) -> anyhow::Result<Utf8PathBuf> {
-    let files = glob::glob(&format!("{directory}/{prefix}*{suffix}"))?
-        .into_iter()
-        .collect::<Result<Vec<_>, _>>()?;
+    let files =
+        glob::glob(&format!("{directory}/{prefix}*{suffix}"))?.collect::<Result<Vec<_>, _>>()?;
     match files.len() {
         0 => Err(anyhow::anyhow!("No file with prefix {prefix} found in {directory}")),
         1 => Ok(Utf8PathBuf::from_path_buf(files[0].clone()).unwrap()),