Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Parsing over a slice should invoke complete parsers #172

Merged
merged 5 commits into from
Feb 16, 2023

Conversation

epage
Copy link
Collaborator

@epage epage commented Feb 16, 2023

Under the original nom design, users could mix and match complete/streaming parsers as needed. Now, they can't. This restores that ability by modifying the stream. As part of that, we apply this to two existing parsers, length_value and Parser::and_then

The problem is this comes with a 30% performance hit for partial parsing because we increased the size of the Stream (I benchmarked with is_partial returning a static value and no change). See #72 for fixing that.

Despite the performance degradation, I'm going to merge this as this is necessary functionality for parsers to work correctly and we have #72 for improving the performance.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4196969852

  • 26 of 65 (40.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 52.466%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/stream/mod.rs 22 61 36.07%
Files with Coverage Reduction New Missed Lines %
src/character/complete.rs 1 81.45%
Totals Coverage Status
Change from base Build 4196095385: -0.2%
Covered Lines: 1734
Relevant Lines: 3305

💛 - Coveralls

@epage epage merged commit 59dd2db into winnow-rs:main Feb 16, 2023
@epage epage deleted the partial branch February 16, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants