forked from Rust-related/RustPython
Fix remaining clippy errors to get master green
This commit is contained in:
@@ -17,7 +17,7 @@ use crate::obj::objtype;
|
||||
use crate::pyobject::{PyObjectRef, PyResult, TypeProtocol};
|
||||
use crate::vm::VirtualMachine;
|
||||
|
||||
use std::cmp::{Ord, Ordering};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
// Helper macro:
|
||||
macro_rules! make_math_func {
|
||||
@@ -325,10 +325,10 @@ fn math_remainder(x: IntoPyFloat, y: IntoPyFloat, vm: &VirtualMachine) -> PyResu
|
||||
let modulus = absx % absy;
|
||||
|
||||
let c = absy - modulus;
|
||||
let r = match modulus.cmp(&c) {
|
||||
Ordering::Less => modulus,
|
||||
Ordering::Greater => -c,
|
||||
Ordering::Equal => modulus - 2.0 * fmod(0.5 * (absx - modulus), absy),
|
||||
let r = match modulus.partial_cmp(&c) {
|
||||
Some(Ordering::Less) => modulus,
|
||||
Some(Ordering::Greater) => -c,
|
||||
_ => modulus - 2.0 * fmod(0.5 * (absx - modulus), absy),
|
||||
};
|
||||
|
||||
return Ok(1.0_f64.copysign(x) * r);
|
||||
|
||||
Reference in New Issue
Block a user