diff --git a/src/work.rs b/src/work.rs index d1dc510..a789090 100644 --- a/src/work.rs +++ b/src/work.rs @@ -1,5 +1,5 @@ use super::*; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use std::collections::HashMap; use std::io; @@ -15,12 +15,6 @@ use data::FsInfo; use state::State; use data::INodeInfoGraph; -/// Join a root path onto this hashmap. -fn join_root<'a>(root: impl AsRef + 'a, map: HashMap) -> impl Iterator + 'a -{ - map.into_iter().map(move |(k, v)| (root.as_ref().join(k), v)) -} - async fn process_entry(entry: &tokio::fs::DirEntry, parent: INode) -> io::Result { let meta = entry.metadata().await?; @@ -50,7 +44,6 @@ pub async fn work_on_all(state: State) -> INodeInfoGraph let inode = meta.inode(); tokio::spawn(walk(state.clone(), path, inode)).await .ok() - //.map(move |res| (res, path)) }, Err(err) => { eprintln!("Failed to stat root {:?}: {}", path, err); @@ -72,19 +65,7 @@ pub async fn work_on_all(state: State) -> INodeInfoGraph if let Some(res) = path_comp { output.extend(res); - /* - for (path, ino) in res.into_iter() - { - // If this inode is not in the map, this is a top-level path. - - //if let Some(_) = ino_map.get(&ino) { - - output.insert(path, ino); //XXX: Why does `output` always end up empty??? - //} else { - // eprintln!("No ino entry for {:?} ({:?})", path, ino); - //} - }*/ } } @@ -153,7 +134,7 @@ fn walk(state: State, root: PathBuf, root_ino: INode) -> BoxFuture<'static, Hash { if let Ok(map) = child { - output.extend(map);//join_root(&root, map)); + output.extend(map); } else { eprintln!("Child panic"); }