use super::object::{Object, TextMarkup}; #[derive(Debug)] pub struct Paragraph<'s> { pub source: &'s str, pub children: Vec>, } #[derive(Debug)] pub struct Comment<'s> { pub source: &'s str, } impl<'s> Paragraph<'s> { pub fn of_text(input: &'s str) -> Self { let mut objects = Vec::with_capacity(1); objects.push(Object::TextMarkup(TextMarkup { source: input })); Paragraph { source: input, children: objects, } } }