-
-
Save erickt/4cebaf11519569750892 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn process_files(files: Vec<File>, progress: Sender<uint>) { | |
let mut count = 0; | |
let mut it = files.iter().inspect(|_| count += 1).filter(|&f| test_file(f)).enumerate(); | |
loop { | |
let (i, f) = match it.next() { | |
None => break, | |
Some(x) => x | |
}; | |
if i % 100 == 0 { | |
progress.send(files.len() - count); | |
} | |
process_file(f); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment