Keep track of actual file name in VfsItem.

This should fix the case of a partition pointed directly at a file
turning the object into a `StringValue`.

Fixes #57.
This commit is contained in:
Lucien Greathouse
2018-04-20 23:13:43 -07:00
parent 9e956e593d
commit 187194a615
3 changed files with 13 additions and 1 deletions

View File

@@ -111,8 +111,11 @@ impl VfsSession {
}
}
let file_name = path.file_name().unwrap().to_string_lossy().into_owned();
Ok(VfsItem::Dir {
route: route.iter().cloned().collect::<Vec<_>>(),
file_name,
children,
})
}
@@ -131,8 +134,11 @@ impl VfsSession {
Err(_) => return Err(()),
}
let file_name = path.file_name().unwrap().to_string_lossy().into_owned();
Ok(VfsItem::File {
route: route.iter().cloned().collect::<Vec<_>>(),
file_name,
contents,
})
}