10691: minor: Use array `into_iter` in more places r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2021-11-04 05:52:05 +00:00 committed by GitHub
commit c96481e25f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 11 deletions

View file

@ -43,8 +43,7 @@ impl Sysroot {
// core is added as a dependency before std in order to
// mimic rustcs dependency order
["core", "alloc", "std"]
.iter()
.copied()
.into_iter()
.zip(iter::repeat(true))
.chain(iter::once(("test", false)))
.filter_map(move |(name, prelude)| Some((name, self.by_name(name)?, prelude)))
@ -78,7 +77,7 @@ impl Sysroot {
for path in SYSROOT_CRATES.trim().lines() {
let name = path.split('/').last().unwrap();
let root = [format!("{}/src/lib.rs", path), format!("lib{}/lib.rs", path)]
.iter()
.into_iter()
.map(|it| sysroot.root.join(it))
.filter_map(|it| ManifestPath::try_from(it).ok())
.find(|it| fs::metadata(it).is_ok());