make Parser::push more flexible

This commit is contained in:
KitsuneCafe 2024-02-04 16:41:12 -05:00
parent 3059a3b774
commit cf2c0af0d5

View file

@ -23,8 +23,8 @@ impl<'a> Parser<'a> {
Parser { steps: Vec::new() }
}
pub fn push<P: Parse>(&mut self, parser: &'a mut P) {
self.steps.push(parser);
pub fn push<P: Into<&'a mut dyn Parse>>(&mut self, parser: P) {
self.steps.push(parser.into());
}
}