Skip to content

Convert NaiveDate::from_num_days_from_ce to return Result#1470

Merged
pitdicker merged 1 commit intochronotope:0.5.xfrom
Zomtir:from_num_days_from_ce
Feb 29, 2024
Merged

Convert NaiveDate::from_num_days_from_ce to return Result#1470
pitdicker merged 1 commit intochronotope:0.5.xfrom
Zomtir:from_num_days_from_ce

Conversation

@Zomtir
Copy link
Copy Markdown
Contributor

@Zomtir Zomtir commented Feb 28, 2024

This pull request targets the issue #1469. The implementation is based on the discussion in #1445.

  • Convert NaiveDate::from_num_days_from_ce to return Result
  • i32::checked_add() is mapped locally to an Err(Error::OutOfRange) for now

cc @pitdicker

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.34%. Comparing base (999582e) to head (bd44d85).

Additional details and impacted files
@@            Coverage Diff             @@
##            0.5.x    #1470      +/-   ##
==========================================
- Coverage   94.34%   94.34%   -0.01%     
==========================================
  Files          37       37              
  Lines       17009    17007       -2     
==========================================
- Hits        16047    16045       -2     
  Misses        962      962              

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

@Zomtir Zomtir force-pushed the from_num_days_from_ce branch from ba41893 to c95c67d Compare February 28, 2024 15:03
Comment thread src/naive/date/mod.rs Outdated
@pitdicker
Copy link
Copy Markdown
Collaborator

It may be for the best that you didn't start with the timestamp methods on NaiveDateTime #1471.

@pitdicker pitdicker merged commit 4d63ace into chronotope:0.5.x Feb 29, 2024
@pitdicker
Copy link
Copy Markdown
Collaborator

Your first one in 🎉.

@Zomtir Zomtir deleted the from_num_days_from_ce branch February 29, 2024 14:02
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.

3 participants