Skip to content

Commit 9de79d6

Browse files
committed
chore: cargo fmt
1 parent b0f162a commit 9de79d6

File tree

6 files changed

+34
-40
lines changed

6 files changed

+34
-40
lines changed

src/scalar/complex.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,7 @@ macro_rules! impl_complex (
468468
)*)
469469
);
470470

471-
#[cfg(all(
472-
not(feature = "std"),
473-
not(feature = "libm_force"),
474-
feature = "libm"
475-
))]
471+
#[cfg(all(not(feature = "std"), not(feature = "libm_force"), feature = "libm"))]
476472
impl_complex!(
477473
f32, f32, Float;
478474
f64, f64, Float
@@ -1441,7 +1437,7 @@ impl<N: RealField + PartialOrd> ComplexField for num_complex::Complex<N> {
14411437
let two = one.clone() + one.clone();
14421438
two.clone()
14431439
* (((self.clone() + one.clone()) / two.clone()).sqrt() + ((self - one) / two).sqrt())
1444-
.ln()
1440+
.ln()
14451441
}
14461442

14471443
/// Computes the principal value of inverse hyperbolic tangent of `self`.

src/scalar/field.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ use num::NumAssign;
33
pub use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};
44

55
/// Trait __alias__ for `Add` with result of type `Self`.
6-
pub trait ClosedAdd<Right = Self>: Sized + Add<Right, Output=Self> {}
6+
pub trait ClosedAdd<Right = Self>: Sized + Add<Right, Output = Self> {}
77

88
/// Trait __alias__ for `Sub` with result of type `Self`.
9-
pub trait ClosedSub<Right = Self>: Sized + Sub<Right, Output=Self> {}
9+
pub trait ClosedSub<Right = Self>: Sized + Sub<Right, Output = Self> {}
1010

1111
/// Trait __alias__ for `Mul` with result of type `Self`.
12-
pub trait ClosedMul<Right = Self>: Sized + Mul<Right, Output=Self> {}
12+
pub trait ClosedMul<Right = Self>: Sized + Mul<Right, Output = Self> {}
1313

1414
/// Trait __alias__ for `Div` with result of type `Self`.
15-
pub trait ClosedDiv<Right = Self>: Sized + Div<Right, Output=Self> {}
15+
pub trait ClosedDiv<Right = Self>: Sized + Div<Right, Output = Self> {}
1616

1717
/// Trait __alias__ for `Neg` with result of type `Self`.
18-
pub trait ClosedNeg: Sized + Neg<Output=Self> {}
18+
pub trait ClosedNeg: Sized + Neg<Output = Self> {}
1919

2020
/// Trait __alias__ for `Add` and `AddAssign` with result of type `Self`.
2121
pub trait ClosedAddAssign<Right = Self>: ClosedAdd<Right> + AddAssign<Right> {}
@@ -29,15 +29,15 @@ pub trait ClosedMulAssign<Right = Self>: ClosedMul<Right> + MulAssign<Right> {}
2929
/// Trait __alias__ for `Div` and `DivAssign` with result of type `Self`.
3030
pub trait ClosedDivAssign<Right = Self>: ClosedDiv<Right> + DivAssign<Right> {}
3131

32-
impl<T, Right> ClosedAdd<Right> for T where T: Add<Right, Output=T> + AddAssign<Right> {}
32+
impl<T, Right> ClosedAdd<Right> for T where T: Add<Right, Output = T> + AddAssign<Right> {}
3333

34-
impl<T, Right> ClosedSub<Right> for T where T: Sub<Right, Output=T> + SubAssign<Right> {}
34+
impl<T, Right> ClosedSub<Right> for T where T: Sub<Right, Output = T> + SubAssign<Right> {}
3535

36-
impl<T, Right> ClosedMul<Right> for T where T: Mul<Right, Output=T> + MulAssign<Right> {}
36+
impl<T, Right> ClosedMul<Right> for T where T: Mul<Right, Output = T> + MulAssign<Right> {}
3737

38-
impl<T, Right> ClosedDiv<Right> for T where T: Div<Right, Output=T> + DivAssign<Right> {}
38+
impl<T, Right> ClosedDiv<Right> for T where T: Div<Right, Output = T> + DivAssign<Right> {}
3939

40-
impl<T> ClosedNeg for T where T: Neg<Output=T> {}
40+
impl<T> ClosedNeg for T where T: Neg<Output = T> {}
4141

4242
impl<T, Right> ClosedAddAssign<Right> for T where T: ClosedAdd<Right> + AddAssign<Right> {}
4343

src/scalar/real.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use num::Float;
1313
/// Trait shared by all reals.
1414
#[allow(missing_docs)]
1515
pub trait RealField:
16-
ComplexField<RealField=Self>
17-
+ RelativeEq<Epsilon=Self>
18-
+ UlpsEq<Epsilon=Self>
19-
+ Signed
20-
+ PartialOrd
16+
ComplexField<RealField = Self>
17+
+ RelativeEq<Epsilon = Self>
18+
+ UlpsEq<Epsilon = Self>
19+
+ Signed
20+
+ PartialOrd
2121
{
2222
/// Is the sign of this real number positive?
2323
fn is_sign_positive(&self) -> bool;
@@ -208,11 +208,7 @@ macro_rules! impl_real (
208208
)*)
209209
);
210210

211-
#[cfg(all(
212-
not(feature = "std"),
213-
not(feature = "libm_force"),
214-
feature = "libm"
215-
))]
211+
#[cfg(all(not(feature = "std"), not(feature = "libm_force"), feature = "libm"))]
216212
impl_real!(f32, f32, Float, Float; f64, f64, Float, Float);
217213
#[cfg(all(feature = "std", not(feature = "libm_force")))]
218214
impl_real!(f32, f32, f32, f32; f64, f64, f64, f64);

src/simd/portable_simd_impl.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ use std::{
1919
RemAssign, Sub, SubAssign,
2020
},
2121
simd::{
22-
self as portable_simd, num::SimdFloat, num::SimdInt, cmp::SimdOrd, cmp::SimdPartialEq,
23-
cmp::SimdPartialOrd as PortableSimdPartialOrd, num::SimdUint, StdFloat, },
22+
self as portable_simd, cmp::SimdOrd, cmp::SimdPartialEq,
23+
cmp::SimdPartialOrd as PortableSimdPartialOrd, num::SimdFloat, num::SimdInt, num::SimdUint,
24+
StdFloat,
25+
},
2426
};
2527

2628
// This is a hack to allow use to reuse `_0` as integers or as identifier,

src/simd/simd_bool.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use std::ops::{BitAnd, BitOr, BitXor, Not};
77
/// It is designed to abstract the behavior of booleans so it can work with multi-lane boolean
88
/// values in an AoSoA setting.
99
pub trait SimdBool:
10-
Copy
11-
+ BitAnd<Self, Output=Self>
12-
+ BitOr<Self, Output=Self>
13-
+ BitXor<Self, Output=Self>
14-
+ Not<Output=Self>
10+
Copy
11+
+ BitAnd<Self, Output = Self>
12+
+ BitOr<Self, Output = Self>
13+
+ BitXor<Self, Output = Self>
14+
+ Not<Output = Self>
1515
{
1616
/// A bit mask representing the boolean state of each lanes of `self`.
1717
///
@@ -36,7 +36,7 @@ Copy
3636
///
3737
/// The implementor of this trait is free to choose on what cases `if_value` and `else_value` are actually
3838
/// called.
39-
fn if_else<Res: SimdValue<SimdBool=Self>>(
39+
fn if_else<Res: SimdValue<SimdBool = Self>>(
4040
self,
4141
if_value: impl FnOnce() -> Res,
4242
else_value: impl FnOnce() -> Res,
@@ -49,7 +49,7 @@ Copy
4949
/// - 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()`.
5050
///
5151
/// The implementor of this trait is free to choose on what cases any of those closures are implemented.
52-
fn if_else2<Res: SimdValue<SimdBool=Self>>(
52+
fn if_else2<Res: SimdValue<SimdBool = Self>>(
5353
self,
5454
if_value: impl FnOnce() -> Res,
5555
else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res),
@@ -64,7 +64,7 @@ Copy
6464
/// - Other lanes will contain the corresponding lane of `else_value()`.
6565
///
6666
/// The implementor of this trait is free to choose on what cases any of those closures are implemented.
67-
fn if_else3<Res: SimdValue<SimdBool=Self>>(
67+
fn if_else3<Res: SimdValue<SimdBool = Self>>(
6868
self,
6969
if_value: impl FnOnce() -> Res,
7070
else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res),
@@ -110,7 +110,7 @@ impl SimdBool for bool {
110110
}
111111

112112
#[inline(always)]
113-
fn if_else<Res: SimdValue<SimdBool=Self>>(
113+
fn if_else<Res: SimdValue<SimdBool = Self>>(
114114
self,
115115
if_value: impl FnOnce() -> Res,
116116
else_value: impl FnOnce() -> Res,
@@ -123,7 +123,7 @@ impl SimdBool for bool {
123123
}
124124

125125
#[inline(always)]
126-
fn if_else2<Res: SimdValue<SimdBool=Self>>(
126+
fn if_else2<Res: SimdValue<SimdBool = Self>>(
127127
self,
128128
if_value: impl FnOnce() -> Res,
129129
else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res),
@@ -139,7 +139,7 @@ impl SimdBool for bool {
139139
}
140140

141141
#[inline(always)]
142-
fn if_else3<Res: SimdValue<SimdBool=Self>>(
142+
fn if_else3<Res: SimdValue<SimdBool = Self>>(
143143
self,
144144
if_value: impl FnOnce() -> Res,
145145
else_if: (impl FnOnce() -> Self, impl FnOnce() -> Res),

src/simd/simd_real.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::simd::{SimdComplexField, SimdPartialOrd, SimdSigned};
77
/// This is implemented by scalar reals like `f32` and `f64` as well as SIMD reals like `portable_simd::f32x4`.
88
#[allow(missing_docs)]
99
pub trait SimdRealField:
10-
SimdPartialOrd + SimdSigned + SimdComplexField<SimdRealField=Self>
10+
SimdPartialOrd + SimdSigned + SimdComplexField<SimdRealField = Self>
1111
{
1212
/// Copies the sign of `sign` to `self`.
1313
///

0 commit comments

Comments
 (0)