@@ -7,7 +7,6 @@ use std::fmt;
77use std:: iter;
88use std:: ops;
99use std:: str;
10- use std:: { i128, i64, u64} ;
1110use web3:: types:: U256 ;
1211
1312/// Compute the two's complement of a U256.
@@ -972,8 +971,8 @@ macro_rules! impl_from {
972971 type Error = TryFromBigIntError ;
973972
974973 fn try_from( value: I256 ) -> Result <Self , Self :: Error > {
975- if value < I256 :: from( Self :: min_value ( ) ) ||
976- value > I256 :: from( Self :: max_value ( ) ) {
974+ if value < I256 :: from( Self :: MIN ) ||
975+ value > I256 :: from( Self :: MAX ) {
977976 return Err ( TryFromBigIntError ) ;
978977 }
979978
@@ -1291,11 +1290,11 @@ mod tests {
12911290 assert_eq ! ( I256 :: one( ) . to_string( ) , "1" ) ;
12921291 assert_eq ! ( I256 :: minus_one( ) . to_string( ) , "-1" ) ;
12931292 assert_eq ! (
1294- I256 :: max_value ( ) . to_string( ) ,
1293+ I256 :: MAX . to_string( ) ,
12951294 "57896044618658097711785492504343953926634992332820282019728792003956564819967"
12961295 ) ;
12971296 assert_eq ! (
1298- I256 :: min_value ( ) . to_string( ) ,
1297+ I256 :: MIN . to_string( ) ,
12991298 "-57896044618658097711785492504343953926634992332820282019728792003956564819968"
13001299 ) ;
13011300 }
@@ -1317,18 +1316,18 @@ mod tests {
13171316 assert_eq!( I256 :: from( -42 as $signed) . to_string( ) , "-42" ) ;
13181317 assert_eq!( I256 :: from( 42 as $signed) . to_string( ) , "42" ) ;
13191318 assert_eq!(
1320- I256 :: from( <$signed>:: max_value ( ) ) . to_string( ) ,
1321- <$signed>:: max_value ( ) . to_string( ) ,
1319+ I256 :: from( <$signed>:: MAX ) . to_string( ) ,
1320+ <$signed>:: MAX . to_string( ) ,
13221321 ) ;
13231322 assert_eq!(
1324- I256 :: from( <$signed>:: min_value ( ) ) . to_string( ) ,
1325- <$signed>:: min_value ( ) . to_string( ) ,
1323+ I256 :: from( <$signed>:: MIN ) . to_string( ) ,
1324+ <$signed>:: MIN . to_string( ) ,
13261325 ) ;
13271326
13281327 assert_eq!( I256 :: from( 42 as $unsigned) . to_string( ) , "42" ) ;
13291328 assert_eq!(
1330- I256 :: from( <$unsigned>:: max_value ( ) ) . to_string( ) ,
1331- <$unsigned>:: max_value ( ) . to_string( ) ,
1329+ I256 :: from( <$unsigned>:: MAX ) . to_string( ) ,
1330+ <$unsigned>:: MAX . to_string( ) ,
13321331 ) ;
13331332
13341333 assert!( matches!( <$signed>:: try_from( small_positive) , Ok ( 42 ) ) ) ;
0 commit comments