Skip to content

Commit 1074883

Browse files
author
CI
committed
FMT & Autofix
1 parent 3507a1d commit 1074883

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

mady_macro_core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ pub fn new() -> Parser {
1515
Parser::new()
1616
.register(Linker::new())
1717
.register(Folder::new())
18-
}
18+
}

mady_math/src/grad.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ mod impl_max {
173173
type Output = Self;
174174
type GradLeft = Self;
175175
type GradRight = Self;
176-
fn grad_max(self: Self, i: Self) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
176+
fn grad_max(
177+
self: Self,
178+
i: Self,
179+
) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
177180
match self.cmp(&i) {
178181
Ordering::Less | Ordering::Equal => (i, (Self::zero(), Self::one())),
179182
Ordering::Greater => (self, (Self::one(), Self::zero())),
@@ -191,7 +194,10 @@ mod impl_max {
191194
type Output = Self;
192195
type GradLeft = Self;
193196
type GradRight = Self;
194-
fn grad_max(self: Self, i: Self) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
197+
fn grad_max(
198+
self: Self,
199+
i: Self,
200+
) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
195201
match self.partial_cmp(&i).unwrap() {
196202
Ordering::Less | Ordering::Equal => (i, (Self::zero(), Self::one())),
197203
Ordering::Greater => (self, (Self::one(), Self::zero())),
@@ -215,7 +221,10 @@ mod impl_min {
215221
type Output = Self;
216222
type GradLeft = Self;
217223
type GradRight = Self;
218-
fn grad_min(self: Self, i: Self) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
224+
fn grad_min(
225+
self: Self,
226+
i: Self,
227+
) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
219228
match self.partial_cmp(&i).unwrap() {
220229
Ordering::Less | Ordering::Equal => (self, (Self::one(), Self::zero())),
221230
Ordering::Greater => (i, (Self::zero(), Self::one())),
@@ -233,7 +242,10 @@ mod impl_min {
233242
type Output = Self;
234243
type GradLeft = Self;
235244
type GradRight = Self;
236-
fn grad_min(self: Self, i: Self) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
245+
fn grad_min(
246+
self: Self,
247+
i: Self,
248+
) -> (Self::Output, (Self::GradLeft, Self::GradRight)) {
237249
match self.partial_cmp(&i).unwrap() {
238250
Ordering::Less | Ordering::Equal => (self, (Self::one(), Self::zero())),
239251
Ordering::Greater => (i, (Self::zero(), Self::one())),
@@ -325,7 +337,6 @@ mod impl_div {
325337
impl_trait![parse, i8, i16, i32, i64, i128, isize, f32, f64];
326338
}
327339

328-
329340
// impl_trait![
330341
// GradPow,
331342
// fn grad_pow(self, i: u32) -> (Self, (Self,)) {
@@ -382,7 +393,6 @@ mod impl_div {
382393
// f64
383394
// ];
384395

385-
386396
#[cfg(test)]
387397
mod tests {
388398
use super::*;

0 commit comments

Comments
 (0)