Skip to content

Commit

Permalink
Add missing must_use to is_sign_negative and unpack (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
paupino authored Feb 19, 2022
1 parent 497a1ef commit 1d52589
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ impl Decimal {
/// assert_eq!(false, Decimal::new(1, 0).is_sign_negative());
/// ```
#[inline(always)]
#[must_use]
pub const fn is_sign_negative(&self) -> bool {
self.flags & SIGN_MASK > 0
}
Expand Down Expand Up @@ -1588,6 +1589,7 @@ impl Decimal {
/// negative: false, scale: 28, hi: 1703060790, mid: 185874565, lo: 1102470952 \
/// }");
/// ```
#[must_use]
pub const fn unpack(&self) -> UnpackedDecimal {
UnpackedDecimal {
negative: self.is_sign_negative(),
Expand Down

0 comments on commit 1d52589

Please sign in to comment.