Make converstion to intermediate state async.
We are going to need to do things like call external tools for syntax highlighting so we are going to need async in there eventually.
This commit is contained in:
@@ -9,15 +9,17 @@ pub(crate) struct ISection {
|
||||
}
|
||||
|
||||
impl ISection {
|
||||
pub(crate) fn new<'parse>(
|
||||
pub(crate) async fn new<'parse>(
|
||||
registry: &mut Registry<'parse>,
|
||||
section: &organic::types::Section<'parse>,
|
||||
) -> Result<ISection, CustomError> {
|
||||
let children = section
|
||||
.children
|
||||
.iter()
|
||||
.map(|obj| IElement::new(registry, obj))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for elem in section.children.iter() {
|
||||
ret.push(IElement::new(registry, elem).await?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Ok(ISection { children })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user