Skip to content

Commit ad0f157

Browse files
Seulgi Kimsgkim126
authored andcommitted
Change methods to convert U256 to unsigned primitives
1 parent 6666499 commit ad0f157

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

json/src/uint.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,32 @@ impl From<Uint> for U256 {
3333

3434
impl From<Uint> for u64 {
3535
fn from(f: Uint) -> Self {
36-
Self::from(f.0)
36+
f.0.as_u64()
3737
}
3838
}
3939

4040
impl From<Uint> for u32 {
4141
fn from(f: Uint) -> Self {
42-
Self::from(f.0)
42+
f.0.as_u32()
4343
}
4444
}
4545

4646
impl From<Uint> for u16 {
4747
fn from(f: Uint) -> Self {
48-
u64::from(f.0) as u16
48+
u64::from(f) as u16
4949
}
5050
}
5151

5252
impl From<Uint> for u8 {
5353
fn from(f: Uint) -> Self {
54-
u64::from(f.0) as u8
54+
u64::from(f) as u8
5555
}
5656
}
5757

5858
impl From<Uint> for usize {
5959
fn from(f: Uint) -> Self {
6060
// TODO: clean it after util conversions refactored.
61-
u64::from(f.0) as usize
61+
f.0.as_usize()
6262
}
6363
}
6464

0 commit comments

Comments
 (0)