From 0e7ad1afb471c4e67e080d3568cb20effe35e3d9 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 10 Feb 2021 14:08:39 +0000 Subject: [PATCH] improve path concat --- src/work.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/work.rs b/src/work.rs index f877499..d1dc510 100644 --- a/src/work.rs +++ b/src/work.rs @@ -48,9 +48,9 @@ pub async fn work_on_all(state: State) -> INodeInfoGraph match tokio::fs::symlink_metadata(&path).await { Ok(meta) => { let inode = meta.inode(); - tokio::spawn(walk(state.clone(), path.clone(), inode)).await + tokio::spawn(walk(state.clone(), path, inode)).await .ok() - .map(move |res| (res, path)) + //.map(move |res| (res, path)) }, Err(err) => { eprintln!("Failed to stat root {:?}: {}", path, err); @@ -69,8 +69,10 @@ pub async fn work_on_all(state: State) -> INodeInfoGraph for path_comp in comp_children { - if let Some((res, _root)) = path_comp + 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. @@ -82,7 +84,7 @@ pub async fn work_on_all(state: State) -> INodeInfoGraph //} else { // eprintln!("No ino entry for {:?} ({:?})", path, ino); //} - } + }*/ } }