natter/src/intermediate/plain_text.rs

21 lines
539 B
Rust
Raw Normal View History

use crate::error::CustomError;
use crate::intermediate::util::coalesce_whitespace;
use super::registry::Registry;
#[derive(Debug)]
pub(crate) struct IPlainText {
2023-10-27 23:42:33 +00:00
pub(crate) source: String,
}
impl IPlainText {
2023-10-29 16:15:07 +00:00
pub(crate) async fn new<'intermediate, 'parse>(
registry: &mut Registry<'intermediate, 'parse>,
plain_text: &organic::types::PlainText<'parse>,
) -> Result<IPlainText, CustomError> {
Ok(IPlainText {
source: coalesce_whitespace(plain_text.source).into_owned(),
})
}
}