From 163053b8fa60b53ea99cc115f655e67daa000cab Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Mon, 21 Mar 2022 05:34:36 +0100 Subject: [PATCH] Use truncate instead of drain --- field/src/polynomial/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/field/src/polynomial/mod.rs b/field/src/polynomial/mod.rs index 10394f52..035ee724 100644 --- a/field/src/polynomial/mod.rs +++ b/field/src/polynomial/mod.rs @@ -534,9 +534,7 @@ mod tests { } let b = a.inv_mod_xn(n); let mut m = &a * &b; - if m.coeffs.len() > n { - m.coeffs.drain(n..); - } + m.coeffs.truncate(n); m.trim(); assert_eq!( m,