Make BoxedParser available to releases

This commit is contained in:
Richard Feldman 2019-11-19 06:42:33 -05:00
parent 7050547f9c
commit 1b04830147

View file

@ -1319,12 +1319,10 @@ where
// explosions in types (and thus monomorphization, and thus build time), // explosions in types (and thus monomorphization, and thus build time),
// but has runtime overhead, so we only use these in debug builds. // but has runtime overhead, so we only use these in debug builds.
#[cfg(debug_assertions)]
pub struct BoxedParser<'a, Output> { pub struct BoxedParser<'a, Output> {
parser: Box<dyn Parser<'a, Output> + 'a>, parser: Box<dyn Parser<'a, Output> + 'a>,
} }
#[cfg(debug_assertions)]
impl<'a, Output> BoxedParser<'a, Output> { impl<'a, Output> BoxedParser<'a, Output> {
fn new<P>(parser: P) -> Self fn new<P>(parser: P) -> Self
where where
@ -1336,7 +1334,6 @@ impl<'a, Output> BoxedParser<'a, Output> {
} }
} }
#[cfg(debug_assertions)]
impl<'a, Output> Parser<'a, Output> for BoxedParser<'a, Output> { impl<'a, Output> Parser<'a, Output> for BoxedParser<'a, Output> {
fn parse(&self, arena: &'a Bump, state: State<'a>) -> ParseResult<'a, Output> { fn parse(&self, arena: &'a Bump, state: State<'a>) -> ParseResult<'a, Output> {
self.parser.parse(arena, state) self.parser.parse(arena, state)