@@ -207,7 +207,7 @@ impl From<[u8; 20]> for EthAddress {
207
207
208
208
#[ cfg( test) ]
209
209
mod tests {
210
- use super :: { EthAddress , Felt , FromBytesSliceError , FromFieldElementError } ;
210
+ use super :: { EthAddress , Felt } ;
211
211
212
212
use alloc:: vec:: * ;
213
213
@@ -291,11 +291,12 @@ mod tests {
291
291
#[ test]
292
292
#[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test:: wasm_bindgen_test) ]
293
293
fn test_eth_address_from_felt_error ( ) {
294
- match EthAddress :: from_felt (
294
+ if EthAddress :: from_felt (
295
295
& Felt :: from_hex ( "0x10000000000000000000000000000000000000000" ) . unwrap ( ) ,
296
- ) {
297
- Ok ( _) => panic ! ( "Expected error, but got Ok" ) ,
298
- Err ( FromFieldElementError ) => { }
296
+ )
297
+ . is_ok ( )
298
+ {
299
+ panic ! ( "Expected error, but got Ok" ) ;
299
300
}
300
301
}
301
302
@@ -304,9 +305,8 @@ mod tests {
304
305
fn test_eth_address_from_slice_invalid_slice ( ) {
305
306
let buffer: Vec < u8 > = vec ! [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] ;
306
307
307
- match EthAddress :: try_from ( & buffer[ 0 ..4 ] ) {
308
- Ok ( _) => panic ! ( "Expected error, but got Ok" ) ,
309
- Err ( FromBytesSliceError ) => { }
308
+ if EthAddress :: try_from ( & buffer[ 0 ..4 ] ) . is_ok ( ) {
309
+ panic ! ( "Expected error, but got Ok" ) ;
310
310
}
311
311
}
312
312
}
0 commit comments