mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 07:06:12 +00:00
Add ignoreUnknown to project nodes
This commit is contained in:
@@ -11,6 +11,11 @@ use rbx_tree::RbxValue;
|
|||||||
|
|
||||||
pub static PROJECT_FILENAME: &'static str = "roblox-project.json";
|
pub static PROJECT_FILENAME: &'static str = "roblox-project.json";
|
||||||
|
|
||||||
|
// Serde is silly,
|
||||||
|
const fn yeah() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
enum SourceProjectNode {
|
enum SourceProjectNode {
|
||||||
@@ -21,8 +26,8 @@ enum SourceProjectNode {
|
|||||||
#[serde(rename = "$properties", default = "HashMap::new")]
|
#[serde(rename = "$properties", default = "HashMap::new")]
|
||||||
properties: HashMap<String, RbxValue>,
|
properties: HashMap<String, RbxValue>,
|
||||||
|
|
||||||
// #[serde(rename = "$ignoreUnknown", default = "false")]
|
#[serde(rename = "$ignoreUnknown", default = "yeah")]
|
||||||
// ignore_unknown: bool,
|
ignore_unknown: bool,
|
||||||
|
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
children: HashMap<String, SourceProjectNode>,
|
children: HashMap<String, SourceProjectNode>,
|
||||||
@@ -36,7 +41,7 @@ enum SourceProjectNode {
|
|||||||
impl SourceProjectNode {
|
impl SourceProjectNode {
|
||||||
pub fn into_project_node(self, project_file_location: &Path) -> ProjectNode {
|
pub fn into_project_node(self, project_file_location: &Path) -> ProjectNode {
|
||||||
match self {
|
match self {
|
||||||
SourceProjectNode::Instance { class_name, mut children, properties } => {
|
SourceProjectNode::Instance { class_name, mut children, properties, .. } => {
|
||||||
let mut new_children = HashMap::new();
|
let mut new_children = HashMap::new();
|
||||||
|
|
||||||
for (node_name, node) in children.drain() {
|
for (node_name, node) in children.drain() {
|
||||||
|
|||||||
Reference in New Issue
Block a user