add into<box> :3c

This commit is contained in:
KitsuneCafe 2024-02-04 18:54:05 -05:00
parent cf2c0af0d5
commit 4d50a1d287

View file

@ -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;
} }