We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5135a4 commit 03c77d9Copy full SHA for 03c77d9
packages/std/src/math/uint256.rs
@@ -99,6 +99,8 @@ impl Uint256 {
99
Uint256(U256(words))
100
}
101
102
+ /// A conversion from `Uint128` that, unlike the one provided by the `From` trait,
103
+ /// can be used in a `const` context.
104
pub const fn from_uint128(num: Uint128) -> Self {
105
let num = num.u128();
106
let bytes = num.to_le_bytes();
packages/std/src/math/uint512.rs
@@ -99,6 +99,8 @@ impl Uint512 {
Uint512(U512::from_little_endian(&value))
+ /// A conversion from `Uint256` that, unlike the one provided by the `From` trait,
pub const fn from_uint256(num: Uint256) -> Self {
let uint256_words = num.to_words();
let words: [u64; 8] = [
0 commit comments