mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 06:35:39 +00:00
added attributes to AdjacentMetadata (#624)
* added attributes to AdjacentMetadata * ran fmt
This commit is contained in:
@@ -19,6 +19,9 @@ pub struct AdjacentMetadata {
|
|||||||
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||||
pub properties: HashMap<String, UnresolvedValue>,
|
pub properties: HashMap<String, UnresolvedValue>,
|
||||||
|
|
||||||
|
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||||
|
pub attributes: HashMap<String, UnresolvedValue>,
|
||||||
|
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
pub path: PathBuf,
|
pub path: PathBuf,
|
||||||
}
|
}
|
||||||
@@ -53,6 +56,19 @@ impl AdjacentMetadata {
|
|||||||
snapshot.properties.insert(key, value);
|
snapshot.properties.insert(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !self.attributes.is_empty() {
|
||||||
|
let mut attributes = Attributes::new();
|
||||||
|
|
||||||
|
for (key, unresolved) in self.attributes.drain() {
|
||||||
|
let value = unresolved.resolve_unambiguous()?;
|
||||||
|
attributes.insert(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
snapshot
|
||||||
|
.properties
|
||||||
|
.insert("Attributes".into(), attributes.into());
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user