Skip to content

Commit 35b7187

Browse files
committed
bigint::monty: use infallible conversions in tests
1 parent bb0c932 commit 35b7187

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bigint/src/tests/biguint.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,10 +1092,10 @@ fn test_is_even() {
10921092
#[test]
10931093
fn test_modpow() {
10941094
fn check(b: usize, e: usize, m: usize, r: usize) {
1095-
let big_b: BigUint = FromPrimitive::from_usize(b).unwrap();
1096-
let big_e: BigUint = FromPrimitive::from_usize(e).unwrap();
1097-
let big_m: BigUint = FromPrimitive::from_usize(m).unwrap();
1098-
let big_r: BigUint = FromPrimitive::from_usize(r).unwrap();
1095+
let big_b = BigUint::from(b);
1096+
let big_e = BigUint::from(e);
1097+
let big_m = BigUint::from(m);
1098+
let big_r = BigUint::from(r);
10991099

11001100
assert_eq!(big_b.modpow(&big_e, &big_m), big_r);
11011101
}

0 commit comments

Comments
 (0)