Skip to content

Commit c0c62db

Browse files
committed
chore: Mark methods as const
1 parent 509a855 commit c0c62db

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/num.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ impl U256 {
225225
/// Create a 256-bit unsigned integer from a byte array.
226226
///
227227
/// The byte array is in Big Endian order.
228-
pub fn from_byte_array(bytes: [u8; 32]) -> Self {
228+
pub const fn from_byte_array(bytes: [u8; 32]) -> Self {
229229
Self(bytes)
230230
}
231231

232232
/// Convert the integer to a byte array.
233233
///
234234
/// The byte array is in Big Endian order.
235-
pub fn to_byte_array(self) -> [u8; 32] {
235+
pub const fn to_byte_array(self) -> [u8; 32] {
236236
self.0
237237
}
238238
}

src/value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,12 @@ impl From<UIntValue> for Value {
607607

608608
impl Value {
609609
/// Access the inner structure of the value.
610-
pub fn inner(&self) -> &ValueInner {
610+
pub const fn inner(&self) -> &ValueInner {
611611
&self.inner
612612
}
613613

614614
/// Access the type of the value.
615-
pub fn ty(&self) -> &ResolvedType {
615+
pub const fn ty(&self) -> &ResolvedType {
616616
&self.ty
617617
}
618618

0 commit comments

Comments
 (0)