Skip to content

Commit

Permalink
tz: add one bug fix
Browse files Browse the repository at this point in the history
I meant to include this in #234, but it slipped my notice.

Basically, if two offsets compare equal as-is, then it should always
return true. Before this, if our parsed offset was `-00:44:30` and the
time zone offset was `-00:44:30`, we were returning them as not equal
because we skipped to rounding the latter to the nearest minute.

I fixed this in the parser implementation but forgot to fix it in the
doc example. That's what this commit does.
  • Loading branch information
BurntSushi committed Feb 1, 2025
1 parent 85e2b5a commit b0c3a38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tz/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ impl OffsetConflict {
/// for the given datetime unambiguously has offset -00:44:30",
/// );
/// let is_equal = |parsed: Offset, candidate: Offset| {
/// candidate.round(Unit::Minute).map_or(
/// parsed == candidate || candidate.round(Unit::Minute).map_or(
/// parsed == candidate,
/// |candidate| parsed == candidate,
/// )
Expand Down

0 comments on commit b0c3a38

Please sign in to comment.