Skip to content

Commit

Permalink
Change OffsetDateTime to store local datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Jul 30, 2022
1 parent ab17a66 commit 7be38dc
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 226 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ path = "benchmarks/main.rs"

[profile.dev]
debug = 0

[profile.test]
debug = 2
5 changes: 5 additions & 0 deletions src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ impl Date {
/// guaranteed by the caller.
#[doc(hidden)]
pub const fn __from_ordinal_date_unchecked(year: i32, ordinal: u16) -> Self {
debug_assert!(year >= MIN_YEAR);
debug_assert!(year <= MAX_YEAR);
debug_assert!(ordinal != 0);
debug_assert!(ordinal <= days_in_year(year));

Self {
value: (year << 9) | ordinal as i32,
}
Expand Down
Loading

0 comments on commit 7be38dc

Please sign in to comment.