Skip to content

Conversation

@pitdicker
Copy link
Collaborator

@pitdicker pitdicker commented Feb 27, 2024

This does not remove the range checks from the Parsed::to_* methods, because as long as the fields are public they can be set to an out of range value. Something to do on the 0.5.x branch.

@codecov
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 70.46632% with 57 lines in your changes are missing coverage. Please review.

Project coverage is 91.93%. Comparing base (e292d9b) to head (23a65df).
Report is 15 commits behind head on main.

❗ Current head 23a65df differs from pull request most recent head 15f7e62. Consider uploading reports for the commit 15f7e62 to get more accurate results

Files Patch % Lines
src/format/parsed.rs 70.46% 57 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1465      +/-   ##
==========================================
- Coverage   92.16%   91.93%   -0.24%     
==========================================
  Files          40       40              
  Lines       18052    18218     +166     
==========================================
+ Hits        16637    16748     +111     
- Misses       1415     1470      +55     

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

@pitdicker
Copy link
Collaborator Author

@djc When you have time, can you look at the direction of the documentation in the last commit? Then I'll merge squash it into the right commit.

I would like to start building on top of this PR 😄.

@pitdicker pitdicker force-pushed the parsed_range_checks branch from 23a65df to fdeb06d Compare March 6, 2024 12:43
set_if_consistent(&mut self.offset, i32::try_from(value).map_err(|_| OUT_OF_RANGE)?)
}

/// Get the `year` field if set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add these below the to_* methods, since they're pretty trivial?

@pitdicker pitdicker force-pushed the parsed_range_checks branch from fdeb06d to 15f7e62 Compare March 6, 2024 12:54
@pitdicker pitdicker merged commit 90dbd75 into chronotope:main Mar 6, 2024
@pitdicker pitdicker deleted the parsed_range_checks branch March 6, 2024 13:01
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