@@ -349,55 +349,67 @@ mod tests {
349
349
test_serde ( i64:: min_value ( ) , b"\x0C \x7f \xff \xff \xff \xff \xff \xff \xff " ) ;
350
350
351
351
test_serde ( 9252427359321063944i128 , b"\x1c \x80 g9\xa9 np\x02 \x08 " ) ;
352
- assert ! ( matches!(
353
- unpack:: <i64 >( b"\x1c \x80 g9\xa9 np\x02 \x08 " ) . unwrap_err( ) ,
354
- PackError :: UnsupportedIntLength
355
- ) ) ;
352
+ assert ! (
353
+ match unpack:: <i64 >( b"\x1c \x80 g9\xa9 np\x02 \x08 " ) . unwrap_err( ) {
354
+ PackError :: UnsupportedIntLength => true ,
355
+ _ => false ,
356
+ }
357
+ ) ;
356
358
357
359
test_serde (
358
360
-9252427359321063944i128 ,
359
361
b"\x0c \x7f \x98 \xc6 V\x91 \x8f \xfd \xf7 " ,
360
362
) ;
361
- assert ! ( matches!(
362
- unpack:: <i64 >( b"\x0c \x7f \x98 \xc6 V\x91 \x8f \xfd \xf7 " ) . unwrap_err( ) ,
363
- PackError :: UnsupportedIntLength
364
- ) ) ;
363
+ assert ! (
364
+ match unpack:: <i64 >( b"\x0c \x7f \x98 \xc6 V\x91 \x8f \xfd \xf7 " ) . unwrap_err( ) {
365
+ PackError :: UnsupportedIntLength => true ,
366
+ _ => false ,
367
+ }
368
+ ) ;
365
369
366
370
test_serde (
367
371
u64:: max_value ( ) as i128 ,
368
372
b"\x1c \xff \xff \xff \xff \xff \xff \xff \xff " ,
369
373
) ;
370
- assert ! ( matches!(
371
- unpack:: <i64 >( b"\x1c \xff \xff \xff \xff \xff \xff \xff \xff " ) . unwrap_err( ) ,
372
- PackError :: UnsupportedIntLength
373
- ) ) ;
374
+ assert ! (
375
+ match unpack:: <i64 >( b"\x1c \xff \xff \xff \xff \xff \xff \xff \xff " ) . unwrap_err( ) {
376
+ PackError :: UnsupportedIntLength => true ,
377
+ _ => false ,
378
+ }
379
+ ) ;
374
380
375
381
test_serde (
376
382
-( u64:: max_value ( ) as i128 ) ,
377
383
b"\x0c \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " ,
378
384
) ;
379
- assert ! ( matches!(
380
- unpack:: <i64 >( b"\x0c \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " ) . unwrap_err( ) ,
381
- PackError :: UnsupportedIntLength
382
- ) ) ;
385
+ assert ! (
386
+ match unpack:: <i64 >( b"\x0c \x00 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " ) . unwrap_err( ) {
387
+ PackError :: UnsupportedIntLength => true ,
388
+ _ => false ,
389
+ }
390
+ ) ;
383
391
384
392
test_serde (
385
393
( i64:: max_value ( ) as i128 ) + 1 ,
386
394
b"\x1c \x80 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " ,
387
395
) ;
388
- assert ! ( matches!(
389
- unpack:: <i64 >( b"\x1c \x80 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " ) . unwrap_err( ) ,
390
- PackError :: UnsupportedIntLength
391
- ) ) ;
396
+ assert ! (
397
+ match unpack:: <i64 >( b"\x1c \x80 \x00 \x00 \x00 \x00 \x00 \x00 \x00 " ) . unwrap_err( ) {
398
+ PackError :: UnsupportedIntLength => true ,
399
+ _ => false ,
400
+ }
401
+ ) ;
392
402
393
403
test_serde (
394
404
( i64:: min_value ( ) as i128 ) - 1 ,
395
405
b"\x0c \x7f \xff \xff \xff \xff \xff \xff \xfe " ,
396
406
) ;
397
- assert ! ( matches!(
398
- unpack:: <i64 >( b"\x0c \x7f \xff \xff \xff \xff \xff \xff \xfe " ) . unwrap_err( ) ,
399
- PackError :: UnsupportedIntLength
400
- ) ) ;
407
+ assert ! (
408
+ match unpack:: <i64 >( b"\x0c \x7f \xff \xff \xff \xff \xff \xff \xfe " ) . unwrap_err( ) {
409
+ PackError :: UnsupportedIntLength => true ,
410
+ _ => false ,
411
+ }
412
+ ) ;
401
413
}
402
414
403
415
#[ cfg( feature = "num-bigint" ) ]
0 commit comments