Clean up VFS code to make it much more robust

This commit is contained in:
Lucien Greathouse
2018-11-17 00:04:44 -08:00
parent b4fd2e31b3
commit 38e0f82812
3 changed files with 112 additions and 71 deletions

View File

@@ -37,8 +37,12 @@ impl RbxSession {
}
}
pub fn path_created_or_updated(&mut self, path: &Path) {
info!("Path changed: {}", path.display());
pub fn path_created(&mut self, path: &Path) {
info!("Path created: {}", path.display());
}
pub fn path_updated(&mut self, path: &Path) {
info!("Path updated: {}", path.display());
}
pub fn path_removed(&mut self, path: &Path) {
@@ -121,7 +125,7 @@ fn construct_sync_point_node(
) {
match vfs.get(&file_path) {
Some(VfsItem::File(file)) => {
let contents = str::from_utf8(vfs.get_contents(&file.path).unwrap()).unwrap();
let contents = str::from_utf8(&file.contents).unwrap();
let mut properties = HashMap::new();
properties.insert("Source".to_string(), RbxValue::String { value: contents.to_string() });