mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Switch RbxValue to an enum
This commit is contained in:
@@ -3,8 +3,13 @@ use std::collections::HashMap;
|
||||
|
||||
use id::Id;
|
||||
|
||||
// TODO: Switch to enum to represent more value types
|
||||
pub type RbxValue = String;
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum RbxValue {
|
||||
String {
|
||||
value: String,
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
@@ -6,7 +6,7 @@ use id::{Id, get_id};
|
||||
use message_session::{Message, MessageSession};
|
||||
use partition::Partition;
|
||||
use project::Project;
|
||||
use rbx::{RbxInstance, RbxTree};
|
||||
use rbx::{RbxInstance, RbxTree, RbxValue};
|
||||
use vfs_session::{VfsSession, FileItem, FileChange};
|
||||
|
||||
// TODO: Rethink data structure and insertion/update behavior. Maybe break some
|
||||
@@ -51,7 +51,7 @@ fn file_to_instances(
|
||||
};
|
||||
|
||||
let mut properties = HashMap::new();
|
||||
properties.insert(property_key.to_string(), contents.clone());
|
||||
properties.insert(property_key.to_string(), RbxValue::String { value: contents.clone() });
|
||||
|
||||
tree.insert_instance(primary_id, RbxInstance {
|
||||
name: name.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user