Skip to content

Commit 599090e

Browse files
committed
Made input bound on select more permissive
1 parent d5855c1 commit 599090e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/primitive.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,18 +466,21 @@ where
466466

467467
impl<'src, I, O, E, F> Parser<'src, I, O, E> for Select<F, I, O, E>
468468
where
469-
I: ValueInput<'src>,
469+
I: Input<'src>,
470470
I::Token: Clone + 'src,
471471
E: ParserExtra<'src, I>,
472472
F: Fn(I::Token, &mut MapExtra<'src, '_, I, E>) -> Option<O>,
473473
{
474474
#[inline]
475475
fn go<M: Mode>(&self, inp: &mut InputRef<'src, '_, I, E>) -> PResult<M, O> {
476476
let before = inp.save();
477-
let next = inp.next_inner();
477+
let next = inp.next_maybe_inner();
478478
let found = match next {
479479
Some(tok) => {
480-
match (self.filter)(tok.clone(), &mut MapExtra::new(before.cursor(), inp)) {
480+
match (self.filter)(
481+
tok.borrow().clone(),
482+
&mut MapExtra::new(before.cursor(), inp),
483+
) {
481484
Some(out) => return Ok(M::bind(|| out)),
482485
None => Some(tok.into()),
483486
}

0 commit comments

Comments
 (0)