From 20cb32bf1ab6b16c84207d0b993e3ca471d57988 Mon Sep 17 00:00:00 2001 From: "johan.park" Date: Fri, 16 Aug 2019 23:10:13 +0900 Subject: [PATCH] Fix code for rustfmt and clippy --- vm/src/stdlib/math.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vm/src/stdlib/math.rs b/vm/src/stdlib/math.rs index 9ed5a63b4..36b107726 100644 --- a/vm/src/stdlib/math.rs +++ b/vm/src/stdlib/math.rs @@ -7,8 +7,8 @@ use statrs::function::erf::{erf, erfc}; use statrs::function::gamma::{gamma, ln_gamma}; use num_bigint::BigInt; -use num_traits::{One, Zero}; use num_traits::cast::ToPrimitive; +use num_traits::{One, Zero}; use crate::function::PyFuncArgs; use crate::obj::objint::PyIntRef; @@ -234,10 +234,9 @@ fn math_ldexp(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult { arg_check!(vm, args, required = [(value, None), (i, None)]); let value = objfloat::make_float(vm, value)?; let i = objint::get_value(i); - Ok(vm.ctx.new_float(value * (2 as f64).powf(i.to_f64().unwrap()))) + Ok(vm.ctx.new_float(value * (2_f64).powf(i.to_f64().unwrap()))) } - fn math_gcd(a: PyIntRef, b: PyIntRef, vm: &VirtualMachine) -> PyResult { use num_integer::Integer; Ok(vm.new_int(a.as_bigint().gcd(b.as_bigint())))