diff --git a/src/parser/object.rs b/src/parser/object.rs index 0c4b692..95f68c7 100644 --- a/src/parser/object.rs +++ b/src/parser/object.rs @@ -1,6 +1,11 @@ +pub trait Source<'s> { + fn get_source(&'s self) -> &'s str; +} + pub enum Object<'s> { TextMarkup(TextMarkup<'s>), PlainText(PlainText<'s>), + RegularLink(RegularLink<'s>), } pub struct TextMarkup<'s> { @@ -11,8 +16,8 @@ pub struct PlainText<'s> { pub source: &'s str, } -pub trait Source<'s> { - fn get_source(&'s self) -> &'s str; +pub struct RegularLink<'s> { + pub source: &'s str, } impl<'s> Source<'s> for Object<'s> { @@ -20,6 +25,7 @@ impl<'s> Source<'s> for Object<'s> { match self { Object::TextMarkup(obj) => obj.source, Object::PlainText(obj) => obj.source, + Object::RegularLink(obj) => obj.source, } } }