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 IParagraph {
|
||||
}
|
||||
|
||||
impl IParagraph {
|
||||
pub(crate) fn new<'parse>(
|
||||
pub(crate) async fn new<'parse>(
|
||||
registry: &mut Registry<'parse>,
|
||||
paragraph: &organic::types::Paragraph<'parse>,
|
||||
) -> Result<IParagraph, CustomError> {
|
||||
let children = paragraph
|
||||
.children
|
||||
.iter()
|
||||
.map(|obj| IObject::new(registry, obj))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for obj in paragraph.children.iter() {
|
||||
ret.push(IObject::new(registry, obj).await?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Ok(IParagraph { children })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user