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

feat(stream): Add AsciiChar #459

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

feat(stream): Add AsciiChar #459

wants to merge 6 commits into from

Conversation

epage
Copy link
Collaborator

@epage epage commented Feb 6, 2024

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
Copy link

coveralls commented Feb 6, 2024

Pull Request Test Coverage Report for Build 7817064688

  • -89 of 95 (6.32%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-1.1%) to 41.585%

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%
Files with Coverage Reduction New Missed Lines %
src/ascii/mod.rs 2 54.58%
Totals Coverage Status
Change from base Build 7805587131: -1.1%
Covered Lines: 1322
Relevant Lines: 3179

💛 - Coveralls

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

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

Comparison is base (40c2e84) 42.67% compared to head (65da275) 41.58%.

Files Patch % Lines
src/stream/mod.rs 1.26% 78 Missing ⚠️
src/stream/ascii.rs 35.71% 9 Missing ⚠️
src/parser.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@epage epage marked this pull request as draft February 7, 2024 15:20
const fn gen() -> &'static [AsciiChar] {
crate::stream::AS!("a")
}
const S: &'static [AsciiChar] = gen();

Check failure

Code scanning / clippy

constants have by default a 'static lifetime Error

constants have by default a 'static lifetime
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