natter/src/intermediate/plain_text.rs

21 lines
526 B
Rust
Raw Normal View History

use crate::error::CustomError;
use crate::intermediate::util::coalesce_whitespace;
use super::registry::Registry;
2023-10-29 19:36:15 +00:00
#[derive(Debug, Clone)]
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(),
})
}
}