natter/src/intermediate/plain_text.rs

21 lines
476 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 {
source: String,
}
impl IPlainText {
pub(crate) fn new(
registry: &mut Registry<'_>,
plain_text: &organic::types::PlainText<'_>,
) -> Result<IPlainText, CustomError> {
Ok(IPlainText {
source: coalesce_whitespace(plain_text.source).into_owned(),
})
}
}