From a5fdc2a9cc3e693e2345d373616fccd1cec9bb2b Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Wed, 16 Oct 2019 18:28:11 -0700 Subject: [PATCH] Add logging, fix flipped condition on child add --- src/vfs/vfs.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vfs/vfs.rs b/src/vfs/vfs.rs index ee3ee177..5e0f45ee 100644 --- a/src/vfs/vfs.rs +++ b/src/vfs/vfs.rs @@ -167,6 +167,11 @@ impl Vfs { let path = path.as_ref(); if !Self::would_be_resident(&data, path) { + log::trace!( + "Path would not be resident, skipping change: {}", + path.display() + ); + return Ok(()); } @@ -205,6 +210,7 @@ impl Vfs { } } None => { + log::trace!("Inserting new path {}", path.display()); data.insert(path.to_path_buf(), VfsItem::new_from_type(new_type, path)); } } @@ -266,7 +272,7 @@ impl Vfs { if let Some(parent) = path.parent() { if let Some(VfsItem::Directory(dir)) = data.get(parent) { - return !dir.children_enumerated; + return dir.children_enumerated; } } @@ -400,6 +406,7 @@ impl VfsEntry { /// Internal structure describing potentially partially-resident files and /// folders in the `Vfs`. +#[derive(Debug)] pub enum VfsItem { File(VfsFile), Directory(VfsDirectory), @@ -427,11 +434,13 @@ impl VfsItem { } } +#[derive(Debug)] pub struct VfsFile { pub(super) path: PathBuf, pub(super) contents: Option>>, } +#[derive(Debug)] pub struct VfsDirectory { pub(super) path: PathBuf, pub(super) children_enumerated: bool,