natter/src/blog_post/plain_text.rs

18 lines
400 B
Rust
Raw Normal View History

use crate::blog_post::util::coalesce_whitespace;
use crate::error::CustomError;
#[derive(Debug)]
pub(crate) struct PlainText {
source: String,
}
impl PlainText {
pub(crate) fn new(
plain_text: &organic::types::PlainText<'_>,
) -> Result<PlainText, CustomError> {
Ok(PlainText {
source: coalesce_whitespace(plain_text.source).into_owned(),
})
}
}