You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some functions should be rewritten to return a closure instead of applying on the data directly (code is in src/multi/mod.rs):
count
fold_many0
fold_many1
fold_many_m_n
Finally, most of those functions could be refactored, because their previous design using macros did not allow early returns from inside the loop. Since we can do that in a function, they should be easier to rewrite.
The text was updated successfully, but these errors were encountered:
Something I ran into with length_value and length_count: The natural type for the first parser to return is usize because its return value is used as a length or count, respectively. But the current macros allow any parser in the first position that returns a number. For length_value, I’ve simulated this with a trait bound for the first parser that makes it return Into<usize>, but for length_count, that doesn’t work: in at least one place, length_count! is invoked with a first parser that returns u32, which is not Into<usize>.
the code is in
src/multi/macros.rs
. To rewrite:count_fixed
(is it even possible?)length_count
length_data
length_value
Some functions should be rewritten to return a closure instead of applying on the data directly (code is in
src/multi/mod.rs
):count
fold_many0
fold_many1
fold_many_m_n
Finally, most of those functions could be refactored, because their previous design using macros did not allow early returns from inside the loop. Since we can do that in a function, they should be easier to rewrite.
The text was updated successfully, but these errors were encountered: