From 454c92ed26da774c730679e281c5cc21c19b95db Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Fri, 16 Feb 2018 18:11:34 +0100 Subject: [PATCH] Working on new directory traversal --- src/main.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.rs b/src/main.rs index 7a90537..18b8f5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -177,6 +177,20 @@ fn hash_and_send(file_path: &Path, sender: Sender) -> (){ } } +// fn traverse_and_spawn(current_path: &Path, sender: Sender) -> (){ +// if current_path.is_file(){ +// hash_and_send(current_path, sender.clone()); +// } else if current_path.is_dir() { +// vec![fs::read_dir(current_path).unwrap().unwrap().collect::()].par_iter().map(|dir_entry|{ +// if dir_entry.is_dir(){ +// traverse_and_spawn(dir_entry, sender.clone()); +// } else if dir_entry.is_file(){ +// hash_and_send(dir_entry, sender.clone()); +// } +// }); +// } +// } + fn collect_files(current_path: &Path, mut file_set: Vec, pool: ThreadPool, collection_sender: Sender>) -> Vec { //println!("Entering {:?}", current_path.to_str()); if current_path.is_dir(){