Skip to content

Commit 6ec9112

Browse files
committed
chore: Slightly more controversial clippy cleanup
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
1 parent 613b566 commit 6ec9112

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/dist/component/package.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use std::collections::{HashMap, HashSet};
66
use std::fmt;
77
use std::io::{self, ErrorKind as IOErrorKind, Read};
8-
use std::iter::FromIterator;
98
use std::mem;
109
use std::path::{Path, PathBuf};
1110

@@ -273,7 +272,7 @@ fn trigger_children(
273272
.or_insert_with(|| unreachable!());
274273
result += pending.len();
275274
for pending_item in pending.into_iter() {
276-
for mut item in Vec::from_iter(io_executor.execute(pending_item)) {
275+
for mut item in io_executor.execute(pending_item).collect::<Vec<_>>() {
277276
// TODO capture metrics
278277
budget.reclaim(&item);
279278
filter_result(&mut item).chain_err(|| ErrorKind::ExtractingPackage)?;
@@ -319,7 +318,7 @@ fn unpack_without_first_dir<'a, R: Read>(
319318
// drain completed results to keep memory pressure low and respond
320319
// rapidly to completed events even if we couldn't submit work (because
321320
// our unpacked item is pending dequeue)
322-
for mut item in Vec::from_iter(io_executor.completed()) {
321+
for mut item in io_executor.completed().collect::<Vec<_>>() {
323322
// TODO capture metrics
324323
budget.reclaim(&item);
325324
filter_result(&mut item).chain_err(|| ErrorKind::ExtractingPackage)?;
@@ -369,7 +368,7 @@ fn unpack_without_first_dir<'a, R: Read>(
369368
io_executor: &dyn Executor,
370369
mut directories: &mut HashMap<PathBuf, DirStatus>,
371370
) -> Result<()> {
372-
for mut item in Vec::from_iter(io_executor.completed()) {
371+
for mut item in io_executor.completed().collect::<Vec<_>>() {
373372
// TODO capture metrics
374373
budget.reclaim(&item);
375374
filter_result(&mut item).chain_err(|| ErrorKind::ExtractingPackage)?;
@@ -457,7 +456,7 @@ fn unpack_without_first_dir<'a, R: Read>(
457456
}
458457
};
459458

460-
for mut item in Vec::from_iter(io_executor.execute(item)) {
459+
for mut item in io_executor.execute(item).collect::<Vec<_>>() {
461460
// TODO capture metrics
462461
budget.reclaim(&item);
463462
filter_result(&mut item).chain_err(|| ErrorKind::ExtractingPackage)?;
@@ -467,7 +466,7 @@ fn unpack_without_first_dir<'a, R: Read>(
467466

468467
loop {
469468
let mut triggered = 0;
470-
for mut item in Vec::from_iter(io_executor.join()) {
469+
for mut item in io_executor.join().collect::<Vec<_>>() {
471470
// handle final IOs
472471
// TODO capture metrics
473472
budget.reclaim(&item);

0 commit comments

Comments
 (0)