feat: keys

This commit is contained in:
Jonathan Kelley committed 2022-11-03 01:24:20 -07:00
1 parent dddbcfd5e2
commit 584504feb7
10 files changed
+113 -94

No files matched your search

+12
View File
@@ -55,6 +55,18 @@ impl Component {
Ok(())
}
pub fn key(&self) -> Option<&IfmtInput> {
match self
.fields
.iter()
.find(|f| f.name.to_string() == "key")
.map(|f| &f.content)
{
Some(ContentField::Formatted(fmt)) => Some(fmt),
_ => None,
}
}
}
impl Parse for Component {