winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
525 stars 40 forks source link

fix(parser): Switch literal impl's from `one_of` to `literal` #464

Closed epage closed 7 months ago

epage commented 7 months ago

Originally, this was going to be done for performance reasons but when comparing this to the previous commit, tag(char) / char slowed down dramatically in the next_slice benchmark.

However, json benchmark was unchanged. This also (slightly) simplifies traces, is more direct in what it says, and does still speed things up for UTF-8-exclusive chars, so going forward with it.

Fixes #418 Fixes #427

BREAKING CHANGE: char parers now always return char as the output and now require I: Compare<char>

BREAKING CHANGE: u8 parers now require I: Compare<u8>

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 7818956700


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ascii/mod.rs 0 2 0.0%
src/parser.rs 1 3 33.33%
<!-- Total: 1 5 20.0% -->
Totals Coverage Status
Change from base Build 7818240433: 0.1%
Covered Lines: 1319
Relevant Lines: 3089

💛 - Coveralls
codecov[bot] commented 7 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (3373ba1) 42.60% compared to head (502a36f) 42.57%.

Files Patch % Lines
src/ascii/mod.rs 0.00% 2 Missing :warning:
src/parser.rs 33.33% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #464 +/- ## ========================================== - Coverage 42.60% 42.57% -0.04% ========================================== Files 18 18 Lines 3089 3089 ========================================== - Hits 1316 1315 -1 - Misses 1773 1774 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.