Add debug output to Walk::next() impl

This commit is contained in:
Matthias Beyer 2017-06-20 20:32:03 +02:00
parent 54484a6ee7
commit cac3e6114e

View file

@ -105,14 +105,19 @@ impl Iterator for Walk {
type Item = StoreObject; type Item = StoreObject;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
while let Some(something) = self.dirwalker.next() { while let Some(something) = self.dirwalker.next() {
debug!("[Walk] Processing next item: {:?}", something);
match something { match something {
Ok(next) => if next.file_type().is_dir() { Ok(next) => if next.file_type().is_dir() {
debug!("Found directory...");
return Some(StoreObject::Collection(next.path().to_path_buf())) return Some(StoreObject::Collection(next.path().to_path_buf()))
} else if next.file_type().is_file() { } else /* if next.file_type().is_file() */ {
debug!("Found file...");
let n = next.path().to_path_buf(); let n = next.path().to_path_buf();
let sid = match StoreId::new(Some(self.store_path.clone()), n) { let sid = match StoreId::new(Some(self.store_path.clone()), n) {
Err(e) => { Err(e) => {
debug!("Could not construct StoreId object from it");
trace_error(&e); trace_error(&e);
continue; continue;
}, },