mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
added attributes to AdjacentMetadata (#624)
* added attributes to AdjacentMetadata * ran fmt
This commit is contained in:
parent
72d62220e8
commit
9876508887
1 changed files with 16 additions and 0 deletions
|
|
@ -19,6 +19,9 @@ pub struct AdjacentMetadata {
|
|||
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||
pub properties: HashMap<String, UnresolvedValue>,
|
||||
|
||||
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
|
||||
pub attributes: HashMap<String, UnresolvedValue>,
|
||||
|
||||
#[serde(skip)]
|
||||
pub path: PathBuf,
|
||||
}
|
||||
|
|
@ -53,6 +56,19 @@ impl AdjacentMetadata {
|
|||
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(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue