natter/src/intermediate/plain_text.rs

21 lines
519 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 18:14:10 +00:00
pub(crate) async fn new<'b, 'parse>(
registry: &'b mut Registry<'parse>,
plain_text: &'b organic::types::PlainText<'parse>,
) -> Result<IPlainText, CustomError> {
Ok(IPlainText {
source: coalesce_whitespace(plain_text.source).into_owned(),
})
}
}