Skip to content

Commit 3f1973e

Browse files
authored
Merge pull request #742 from finnbear/patch-1
Add `#[inline]` to `Decimal::from_parts` for performance
2 parents 3520d2d + 258b38e commit 3f1973e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/decimal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ impl Decimal {
522522
/// let pi = Decimal::from_parts(1102470952, 185874565, 1703060790, false, 28);
523523
/// assert_eq!(pi.to_string(), "3.1415926535897932384626433832");
524524
/// ```
525+
#[inline]
525526
#[must_use]
526527
pub const fn from_parts(lo: u32, mid: u32, hi: u32, negative: bool, scale: u32) -> Decimal {
527528
assert!(scale <= Self::MAX_SCALE, "Scale exceeds maximum supported scale");

0 commit comments

Comments
 (0)