Skip to content

Commit 9123194

Browse files
authored
Merge pull request CosmWasm#1357 from CosmWasm/inline-zero-one
Inline zero() and one() consistently
2 parents 6b53235 + 7abff65 commit 9123194

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

packages/std/src/math/decimal.rs

+2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ impl Decimal {
4747
}
4848

4949
/// Create a 1.0 Decimal
50+
#[inline]
5051
pub const fn one() -> Self {
5152
Self(Self::DECIMAL_FRACTIONAL)
5253
}
5354

5455
/// Create a 0.0 Decimal
56+
#[inline]
5557
pub const fn zero() -> Self {
5658
Self(Uint128::zero())
5759
}

packages/std/src/math/decimal256.rs

+2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ impl Decimal256 {
5757
}
5858

5959
/// Create a 1.0 Decimal256
60+
#[inline]
6061
pub const fn one() -> Self {
6162
Self(Self::DECIMAL_FRACTIONAL)
6263
}
6364

6465
/// Create a 0.0 Decimal256
66+
#[inline]
6567
pub const fn zero() -> Self {
6668
Self(Uint256::zero())
6769
}

packages/std/src/math/uint128.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl Uint128 {
4545
}
4646

4747
/// Creates a Uint128(0)
48+
#[inline]
4849
pub const fn zero() -> Self {
4950
Uint128(0)
5051
}

packages/std/src/math/uint256.rs

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ impl Uint256 {
6262
}
6363

6464
/// Creates a Uint256(0)
65+
#[inline]
6566
pub const fn zero() -> Self {
6667
Uint256(U256::zero())
6768
}

packages/std/src/math/uint512.rs

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ impl Uint512 {
6262
}
6363

6464
/// Creates a Uint512(0)
65+
#[inline]
6566
pub const fn zero() -> Self {
6667
Uint512(U512::zero())
6768
}

packages/std/src/math/uint64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl Uint64 {
4141
}
4242

4343
/// Creates a Uint64(0)
44+
#[inline]
4445
pub const fn zero() -> Self {
4546
Uint64(0)
4647
}

0 commit comments

Comments
 (0)