From 35b7187e8344f4996711862462d38b53aca549e8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sun, 22 Oct 2017 15:49:51 -0700 Subject: [PATCH] bigint::monty: use infallible conversions in tests --- bigint/src/tests/biguint.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bigint/src/tests/biguint.rs b/bigint/src/tests/biguint.rs index 89101a6..f66564d 100644 --- a/bigint/src/tests/biguint.rs +++ b/bigint/src/tests/biguint.rs @@ -1092,10 +1092,10 @@ fn test_is_even() { #[test] fn test_modpow() { fn check(b: usize, e: usize, m: usize, r: usize) { - let big_b: BigUint = FromPrimitive::from_usize(b).unwrap(); - let big_e: BigUint = FromPrimitive::from_usize(e).unwrap(); - let big_m: BigUint = FromPrimitive::from_usize(m).unwrap(); - let big_r: BigUint = FromPrimitive::from_usize(r).unwrap(); + let big_b = BigUint::from(b); + let big_e = BigUint::from(e); + let big_m = BigUint::from(m); + let big_r = BigUint::from(r); assert_eq!(big_b.modpow(&big_e, &big_m), big_r); }