mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-03 13:37:37 +00:00
Resolve clippy warnings
This commit is contained in:
parent
6c718b5b8a
commit
f13b54546b
@ -33,8 +33,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
|
|||||||
|
|
||||||
// We need to manually copy libstd to the extracted rustc sysroot
|
// We need to manually copy libstd to the extracted rustc sysroot
|
||||||
copy_directory(
|
copy_directory(
|
||||||
&libstd_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"),
|
&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
|
// 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()
|
.unwrap()
|
||||||
.to_string();
|
.to_string();
|
||||||
let (version, _) =
|
let (version, _) =
|
||||||
archive.strip_prefix("reproducible-artifacts-").unwrap().split_once("-").unwrap();
|
archive.strip_prefix("reproducible-artifacts-").unwrap().split_once('-').unwrap();
|
||||||
Ok(version.to_string())
|
Ok(version.to_string())
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ pub fn gather_llvm_bolt_profiles(env: &Environment) -> anyhow::Result<LlvmBoltPr
|
|||||||
log::info!("Merging LLVM BOLT profiles to {merged_profile}");
|
log::info!("Merging LLVM BOLT profiles to {merged_profile}");
|
||||||
|
|
||||||
let profiles: Vec<_> =
|
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"];
|
let mut merge_args = vec!["merge-fdata"];
|
||||||
merge_args.extend(profiles.iter().map(|p| p.to_str().unwrap()));
|
merge_args.extend(profiles.iter().map(|p| p.to_str().unwrap()));
|
||||||
|
@ -63,7 +63,6 @@ pub fn get_files_from_dir(
|
|||||||
let path = format!("{dir}/*{}", suffix.unwrap_or(""));
|
let path = format!("{dir}/*{}", suffix.unwrap_or(""));
|
||||||
|
|
||||||
Ok(glob::glob(&path)?
|
Ok(glob::glob(&path)?
|
||||||
.into_iter()
|
|
||||||
.map(|p| p.map(|p| Utf8PathBuf::from_path_buf(p).unwrap()))
|
.map(|p| p.map(|p| Utf8PathBuf::from_path_buf(p).unwrap()))
|
||||||
.collect::<Result<Vec<_>, _>>()?)
|
.collect::<Result<Vec<_>, _>>()?)
|
||||||
}
|
}
|
||||||
@ -74,9 +73,8 @@ pub fn find_file_in_dir(
|
|||||||
prefix: &str,
|
prefix: &str,
|
||||||
suffix: &str,
|
suffix: &str,
|
||||||
) -> anyhow::Result<Utf8PathBuf> {
|
) -> anyhow::Result<Utf8PathBuf> {
|
||||||
let files = glob::glob(&format!("{directory}/{prefix}*{suffix}"))?
|
let files =
|
||||||
.into_iter()
|
glob::glob(&format!("{directory}/{prefix}*{suffix}"))?.collect::<Result<Vec<_>, _>>()?;
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
|
||||||
match files.len() {
|
match files.len() {
|
||||||
0 => Err(anyhow::anyhow!("No file with prefix {prefix} found in {directory}")),
|
0 => Err(anyhow::anyhow!("No file with prefix {prefix} found in {directory}")),
|
||||||
1 => Ok(Utf8PathBuf::from_path_buf(files[0].clone()).unwrap()),
|
1 => Ok(Utf8PathBuf::from_path_buf(files[0].clone()).unwrap()),
|
||||||
|
Loading…
Reference in New Issue
Block a user