winnow-rs / winnow

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

feat(stream): Add `AsciiChar` #459

Open epage opened 9 months ago

epage commented 9 months ago

This can be used like u8 or char but its guaranteed to work with both byte streams and &str streams.

A A! macro is introduced to provide a "literal" form of this for easier creation. An invalid value is a compiler error.

The goal is to resolve issues where we could end up splitting on non-UTF8 characters because we allow bytes to be used with &str but we need something that can work with both.

coveralls commented 9 months ago

Pull Request Test Coverage Report for Build 7817064688


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 0 2 0.0%
src/stream/ascii.rs 5 14 35.71%
src/stream/mod.rs 1 79 1.27%
<!-- Total: 6 95 6.32% -->
Files with Coverage Reduction New Missed Lines %
src/ascii/mod.rs 2 54.58%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 7805587131: -1.1%
Covered Lines: 1322
Relevant Lines: 3179

💛 - Coveralls
codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 6.31579% with 89 lines in your changes missing coverage. Please review.

Project coverage is 41.58%. Comparing base (40c2e84) to head (65da275). Report is 279 commits behind head on main.

Files with missing lines Patch % Lines
src/stream/mod.rs 1.26% 78 Missing :warning:
src/stream/ascii.rs 35.71% 9 Missing :warning:
src/parser.rs 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #459 +/- ## ========================================== - Coverage 42.67% 41.58% -1.09% ========================================== Files 18 19 +1 Lines 3084 3179 +95 ========================================== + Hits 1316 1322 +6 - Misses 1768 1857 +89 ```

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