Closed baoyachi closed 10 months ago
0.5.30
The if-else logic in this code appears to have no practical difference. In both the if and else branches, the any::<, _, true>(input) function is called. Consequently, the if-else logic might be redundant.
https://github.com/winnow-rs/winnow/blob/02561943e396aab9fc268ec00c88273e3315ef0a/src/token/mod.rs#L46-L59
pub fn any<I, E: ParserError<I>>(input: &mut I) -> PResult<<I as Stream>::Token, E> where I: StreamIsPartial, I: Stream, { trace("any", move |input: &mut I| { if <I as StreamIsPartial>::is_partial_supported() { + any_::<_, _, true>(input) + } else { + any_::<_, _, true>(input) } }) .parse_next(input) }
The if-else logic might be redundant and can be simplified by directly calling any_::<_, _, true>(input).
any_::<_, _, true>(input)
No response
Please complete the following tasks
winnow version
0.5.30
Describe your use case
The if-else logic in this code appears to have no practical difference. In both the if and else branches, the any::<, _, true>(input) function is called. Consequently, the if-else logic might be redundant.
Describe the solution you'd like
The if-else logic might be redundant and can be simplified by directly calling
any_::<_, _, true>(input)
.Alternatives, if applicable
No response
Additional Context
No response