add into<box> :3c
This commit is contained in:
parent
cf2c0af0d5
commit
4d50a1d287
|
@ -10,6 +10,12 @@ pub trait Parse {
|
||||||
fn parse(&mut self, path: &str, src: &[u8], dst: &mut Vec<u8>) -> Result<(), Error>;
|
fn parse(&mut self, path: &str, src: &[u8], dst: &mut Vec<u8>) -> Result<(), Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, P: Parse + 'static> Into<Box<dyn Parse>> for (P,) {
|
||||||
|
fn into(self) -> Box<dyn Parse> {
|
||||||
|
Box::new(self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub trait AndThenParser<P> {
|
pub trait AndThenParser<P> {
|
||||||
fn and_then(&mut self, parser: P) -> &Self;
|
fn and_then(&mut self, parser: P) -> &Self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue