make Parser::push more flexible
This commit is contained in:
parent
3059a3b774
commit
cf2c0af0d5
|
@ -23,8 +23,8 @@ impl<'a> Parser<'a> {
|
||||||
Parser { steps: Vec::new() }
|
Parser { steps: Vec::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn push<P: Parse>(&mut self, parser: &'a mut P) {
|
pub fn push<P: Into<&'a mut dyn Parse>>(&mut self, parser: P) {
|
||||||
self.steps.push(parser);
|
self.steps.push(parser.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue