Closed lotheac closed 1 year ago
I think the reasoning was that since you are looking for exactly one char, the returned value would always just be that char, so the information is redundant. I think in isolation that reasoning makes sense, but as you have showed, it makes the function play less well with the rest of the library, so it should probably be changed
Hi, thank you for this library.
The following test fails:
This happens because mecha.ascii.char's result type is void, in contrast to the other pub fn parsers in this file (and it seems the same is true for mecha.utf8). I found that difference quite surprising, since it leads to somewhat unintuitive code, eg. when using oneOf() on ascii.range/ascii.digit and ascii.char. Could you shed some light on why the char parsers use discard?