Skip to content

Commit

Permalink
remove misleading rounded and clarify precise docs
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Mar 28, 2024
1 parent 1c40284 commit b89f6c2
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,14 @@ impl<T> MaybeRounded<T> {
}
}

/// Gets the inner value, or `None` if it was affected by DTZ rounding.
/// Gets the inner value, or `None` if it was potentially affected by DTZ
/// rounding.
pub fn precise(self) -> Option<T> {
match self {
MaybeRounded::Precise(v) => Some(v),
MaybeRounded::Rounded(_) => None,
}
}

/// Gets the inner value, *only* if it was affected by DTZ rounding.
pub fn rounded(self) -> Option<T> {
match self {
MaybeRounded::Precise(_) => None,
MaybeRounded::Rounded(v) => Some(v),
}
}
}

impl MaybeRounded<Dtz> {
Expand Down

0 comments on commit b89f6c2

Please sign in to comment.