Skip to content

Commit 5d0745a

Browse files
committed
Make Uint256::new const
1 parent 2dffdd0 commit 5d0745a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and this project adheres to
1010

1111
- cosmwasm-std: Implement `Mul` and `MulAssign` for `Uint128`.
1212
- cosmwasm-std: Implement `FromStr` for `Uint128`, `Uint256`, and `Uint512`.
13-
- cosmwasm-std: Make `Uint256::from_le_bytes` and `::from_be_bytes` const.
13+
- cosmwasm-std: Make `Uint256::from_le_bytes`, `::from_be_bytes` and `::new`
14+
const.
1415

1516
### Changed
1617

packages/std/src/math/uint256.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Uint256 {
5252

5353
/// Creates a Uint256(value) from a big endian representation. It's just an alias for
5454
/// `from_big_endian`.
55-
pub fn new(value: [u8; 32]) -> Self {
55+
pub const fn new(value: [u8; 32]) -> Self {
5656
Self::from_be_bytes(value)
5757
}
5858

0 commit comments

Comments
 (0)