Skip to content

Commit cf27b32

Browse files
committed
Also adds #[inline] to the trivial decimal constructors
1 parent aebbf97 commit cf27b32

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

packages/std/src/math/decimal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl Decimal {
5252
/// let value = Decimal::new(atoms);
5353
/// assert_eq!(value.to_string(), "141183460469231731687.303715884105727125");
5454
/// ```
55+
#[inline]
5556
pub const fn new(value: Uint128) -> Self {
5657
Self(value)
5758
}

packages/std/src/math/decimal256.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl Decimal256 {
5757
/// let value = Decimal256::new(atoms);
5858
/// assert_eq!(value.to_string(), "141183460469231731687.303715884105727125");
5959
/// ```
60+
#[inline]
6061
pub const fn new(value: Uint256) -> Self {
6162
Self(value)
6263
}

packages/std/src/math/signed_decimal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ impl SignedDecimal {
6868
/// # use cosmwasm_std::{SignedDecimal, Int128};
6969
/// assert_eq!(SignedDecimal::new(Int128::one()).to_string(), "0.000000000000000001");
7070
/// ```
71+
#[inline]
7172
pub const fn new(value: Int128) -> Self {
7273
Self(value)
7374
}

packages/std/src/math/signed_decimal_256.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ impl SignedDecimal256 {
8080
/// # use cosmwasm_std::{SignedDecimal256, Int256};
8181
/// assert_eq!(SignedDecimal256::new(Int256::one()).to_string(), "0.000000000000000001");
8282
/// ```
83+
#[inline]
8384
pub const fn new(value: Int256) -> Self {
8485
Self(value)
8586
}

0 commit comments

Comments
 (0)