diff --git a/src/scalar/complex.rs b/src/scalar/complex.rs index e8fed6e..b62269a 100644 --- a/src/scalar/complex.rs +++ b/src/scalar/complex.rs @@ -468,11 +468,7 @@ macro_rules! impl_complex ( )*) ); -#[cfg(all( - not(feature = "std"), - not(feature = "libm_force"), - feature = "libm" -))] +#[cfg(all(not(feature = "std"), not(feature = "libm_force"), feature = "libm"))] impl_complex!( f32, f32, Float; f64, f64, Float @@ -1441,7 +1437,7 @@ impl ComplexField for num_complex::Complex { let two = one.clone() + one.clone(); two.clone() * (((self.clone() + one.clone()) / two.clone()).sqrt() + ((self - one) / two).sqrt()) - .ln() + .ln() } /// Computes the principal value of inverse hyperbolic tangent of `self`. diff --git a/src/scalar/field.rs b/src/scalar/field.rs index 625b1fd..cb96662 100644 --- a/src/scalar/field.rs +++ b/src/scalar/field.rs @@ -3,19 +3,19 @@ use num::NumAssign; pub use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; /// Trait __alias__ for `Add` with result of type `Self`. -pub trait ClosedAdd: Sized + Add {} +pub trait ClosedAdd: Sized + Add {} /// Trait __alias__ for `Sub` with result of type `Self`. -pub trait ClosedSub: Sized + Sub {} +pub trait ClosedSub: Sized + Sub {} /// Trait __alias__ for `Mul` with result of type `Self`. -pub trait ClosedMul: Sized + Mul {} +pub trait ClosedMul: Sized + Mul {} /// Trait __alias__ for `Div` with result of type `Self`. -pub trait ClosedDiv: Sized + Div {} +pub trait ClosedDiv: Sized + Div {} /// Trait __alias__ for `Neg` with result of type `Self`. -pub trait ClosedNeg: Sized + Neg {} +pub trait ClosedNeg: Sized + Neg {} /// Trait __alias__ for `Add` and `AddAssign` with result of type `Self`. pub trait ClosedAddAssign: ClosedAdd + AddAssign {} @@ -29,15 +29,15 @@ pub trait ClosedMulAssign: ClosedMul + MulAssign {} /// Trait __alias__ for `Div` and `DivAssign` with result of type `Self`. pub trait ClosedDivAssign: ClosedDiv + DivAssign {} -impl ClosedAdd for T where T: Add + AddAssign {} +impl ClosedAdd for T where T: Add + AddAssign {} -impl ClosedSub for T where T: Sub + SubAssign {} +impl ClosedSub for T where T: Sub + SubAssign {} -impl ClosedMul for T where T: Mul + MulAssign {} +impl ClosedMul for T where T: Mul + MulAssign {} -impl ClosedDiv for T where T: Div + DivAssign {} +impl ClosedDiv for T where T: Div + DivAssign {} -impl ClosedNeg for T where T: Neg {} +impl ClosedNeg for T where T: Neg {} impl ClosedAddAssign for T where T: ClosedAdd + AddAssign {} diff --git a/src/scalar/real.rs b/src/scalar/real.rs index 3aa0e79..b65dbe2 100644 --- a/src/scalar/real.rs +++ b/src/scalar/real.rs @@ -13,11 +13,11 @@ use num::Float; /// Trait shared by all reals. #[allow(missing_docs)] pub trait RealField: -ComplexField -+ RelativeEq -+ UlpsEq -+ Signed -+ PartialOrd + ComplexField + + RelativeEq + + UlpsEq + + Signed + + PartialOrd { /// Is the sign of this real number positive? fn is_sign_positive(&self) -> bool; @@ -208,11 +208,7 @@ macro_rules! impl_real ( )*) ); -#[cfg(all( - not(feature = "std"), - not(feature = "libm_force"), - feature = "libm" -))] +#[cfg(all(not(feature = "std"), not(feature = "libm_force"), feature = "libm"))] impl_real!(f32, f32, Float, Float; f64, f64, Float, Float); #[cfg(all(feature = "std", not(feature = "libm_force")))] impl_real!(f32, f32, f32, f32; f64, f64, f64, f64); diff --git a/src/simd/portable_simd_impl.rs b/src/simd/portable_simd_impl.rs index 5afa65e..9fc0bdc 100644 --- a/src/simd/portable_simd_impl.rs +++ b/src/simd/portable_simd_impl.rs @@ -19,8 +19,10 @@ use std::{ RemAssign, Sub, SubAssign, }, simd::{ - self as portable_simd, num::SimdFloat, num::SimdInt, cmp::SimdOrd, cmp::SimdPartialEq, - cmp::SimdPartialOrd as PortableSimdPartialOrd, num::SimdUint, StdFloat, }, + self as portable_simd, cmp::SimdOrd, cmp::SimdPartialEq, + cmp::SimdPartialOrd as PortableSimdPartialOrd, num::SimdFloat, num::SimdInt, num::SimdUint, + StdFloat, + }, }; // This is a hack to allow use to reuse `_0` as integers or as identifier, diff --git a/src/simd/simd_bool.rs b/src/simd/simd_bool.rs index 6ae6179..fc6a931 100644 --- a/src/simd/simd_bool.rs +++ b/src/simd/simd_bool.rs @@ -7,11 +7,11 @@ use std::ops::{BitAnd, BitOr, BitXor, Not}; /// It is designed to abstract the behavior of booleans so it can work with multi-lane boolean /// values in an AoSoA setting. pub trait SimdBool: -Copy -+ BitAnd -+ BitOr -+ BitXor -+ Not + Copy + + BitAnd + + BitOr + + BitXor + + Not { /// A bit mask representing the boolean state of each lanes of `self`. /// @@ -36,7 +36,7 @@ Copy /// /// The implementor of this trait is free to choose on what cases `if_value` and `else_value` are actually /// called. - fn if_else>( + fn if_else>( self, if_value: impl FnOnce() -> Res, else_value: impl FnOnce() -> Res, @@ -49,7 +49,7 @@ Copy /// - For each lane of `self` containing `0` but with a corresponding lane of `else_if.0()` containing `0`, the result will contain the corresponding lane of `else_value()`. /// /// The implementor of this trait is free to choose on what cases any of those closures are implemented. - fn if_else2>( + fn if_else2>( self, if_value: impl FnOnce() -> Res, else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res), @@ -64,7 +64,7 @@ Copy /// - Other lanes will contain the corresponding lane of `else_value()`. /// /// The implementor of this trait is free to choose on what cases any of those closures are implemented. - fn if_else3>( + fn if_else3>( self, if_value: impl FnOnce() -> Res, else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res), @@ -110,7 +110,7 @@ impl SimdBool for bool { } #[inline(always)] - fn if_else>( + fn if_else>( self, if_value: impl FnOnce() -> Res, else_value: impl FnOnce() -> Res, @@ -123,7 +123,7 @@ impl SimdBool for bool { } #[inline(always)] - fn if_else2>( + fn if_else2>( self, if_value: impl FnOnce() -> Res, else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res), @@ -139,7 +139,7 @@ impl SimdBool for bool { } #[inline(always)] - fn if_else3>( + fn if_else3>( self, if_value: impl FnOnce() -> Res, else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res), diff --git a/src/simd/simd_real.rs b/src/simd/simd_real.rs index 44aafea..d91e62e 100644 --- a/src/simd/simd_real.rs +++ b/src/simd/simd_real.rs @@ -7,7 +7,7 @@ use crate::simd::{SimdComplexField, SimdPartialOrd, SimdSigned}; /// This is implemented by scalar reals like `f32` and `f64` as well as SIMD reals like `portable_simd::f32x4`. #[allow(missing_docs)] pub trait SimdRealField: -SimdPartialOrd + SimdSigned + SimdComplexField + SimdPartialOrd + SimdSigned + SimdComplexField { /// Copies the sign of `sign` to `self`. ///