From a965955807b30cbe89cd7dbd200bab30d2b38b8c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 23 Apr 2019 09:48:42 -0400 Subject: [PATCH] Make element function public --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9d90b1c..957e555 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,17 +1,17 @@ #[derive(Clone, Debug, PartialEq, Eq)] -struct Element { +pub struct Element { name: String, attributes: Vec<(String, String)>, children: Vec, } -struct BoxedParser<'a, Output> { +pub struct BoxedParser<'a, Output> { parser: Box + 'a>, } -type ParseResult<'a, Output> = Result<(&'a str, Output), &'a str>; +pub type ParseResult<'a, Output> = Result<(&'a str, Output), &'a str>; -trait Parser<'a, Output> { +pub trait Parser<'a, Output> { fn parse(&self, input: &'a str) -> ParseResult<'a, Output>; fn map(self, map_fn: F) -> BoxedParser<'a, NewOutput> @@ -264,7 +264,7 @@ where } } -fn element<'a>() -> impl Parser<'a, Element> { +pub fn element<'a>() -> impl Parser<'a, Element> { whitespace_wrap(either(single_element(), parent_element())) }