From 36530dc69abcd3cfc686c754079d775925356821 Mon Sep 17 00:00:00 2001 From: KitsuneCafe <10284516+kitsunecafe@users.noreply.github.com> Date: Mon, 5 Feb 2024 03:06:23 -0500 Subject: [PATCH] Parse::as_dyn --- src/roxy.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/roxy.rs b/src/roxy.rs index a4264da..bd80992 100644 --- a/src/roxy.rs +++ b/src/roxy.rs @@ -8,16 +8,16 @@ use crate::error::Error; pub trait Parse { fn parse(&mut self, path: &str, src: &[u8], dst: &mut Vec) -> Result<(), Error>; -} -impl<'a, P: Parse + 'static> Into> for (P,) { - fn into(self) -> Box { - Box::new(self.0) + fn as_dyn(&self) -> &dyn Parse where Self: Sized { + self } } -pub trait AndThenParser

{ - fn and_then(&mut self, parser: P) -> &Self; +impl Into> for (P,) { + fn into(self) -> Box { + Box::new(self.0) + } } pub struct Parser<'a> {