Remove RbxSnapshotValue for RbxValue

We can always change RbxValue to use Cow<'a, str> instead of String later if perf needs it
This commit is contained in:
Lucien Greathouse
2018-12-13 10:53:32 -08:00
parent a89fff1a22
commit 4d0a2b806c
2 changed files with 10 additions and 22 deletions

View File

@@ -6,14 +6,14 @@ use std::{
str,
};
use rbx_tree::{RbxTree, RbxId};
use rbx_tree::{RbxTree, RbxValue, RbxId};
use crate::{
project::{Project, ProjectNode, InstanceProjectNode},
message_queue::{Message, MessageQueue},
imfs::{Imfs, ImfsItem, ImfsFile},
path_map::PathMap,
rbx_snapshot::{RbxSnapshotInstance, RbxSnapshotValue, reify_root},
rbx_snapshot::{RbxSnapshotInstance, reify_root},
};
pub struct RbxSession {
@@ -216,7 +216,9 @@ fn snapshot_instances_from_imfs<'a>(imfs: &'a Imfs, imfs_path: &Path) -> Option<
.expect("File did not contain UTF-8 data, which is required for scripts.");
let mut properties = HashMap::new();
properties.insert(String::from("Source"), RbxSnapshotValue::String(Cow::Borrowed(contents)));
properties.insert(String::from("Source"), RbxValue::String {
value: contents.to_string(),
});
Some(RbxSnapshotInstance {
name: Cow::Borrowed(instance_name),