Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ickk committed May 5, 2024
1 parent be422a7 commit 3e33e0f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
59 changes: 31 additions & 28 deletions ega/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,37 @@ pub use operators::*;
pub use outermorphisms::*;
pub use values::*;

/// return `Empty`
#[inline]
fn return_empty<Lhs, Rhs>(_: Lhs, _: Rhs) -> Empty {
Empty
}

/// return the left-hand-side
#[inline]
fn return_lhs<Lhs, Rhs>(lhs: Lhs, _: Rhs) -> Lhs {
lhs
}

/// return the right-hand-side
#[inline]
fn return_rhs<Lhs, Rhs>(_: Lhs, rhs: Rhs) -> Rhs {
rhs
}

/// negate and return the right-hand-side
#[inline]
fn return_neg_rhs<Lhs, Rhs: Neg<Output = Rhs>>(_: Lhs, rhs: Rhs) -> Rhs {
-rhs
}

/// return zero
#[inline]
fn return_zero<Lhs, Rhs, Output: Zero>(_: Lhs, _: Rhs) -> Output {
Output::zero()
pub(crate) use helpers::*;
mod helpers {
use crate::*;
/// return `Empty`
#[inline]
pub(crate) fn return_empty<Lhs, Rhs>(_: Lhs, _: Rhs) -> Empty {
Empty
}
/// return the left-hand-side
#[inline]
pub(crate) fn return_lhs<Lhs, Rhs>(lhs: Lhs, _: Rhs) -> Lhs {
lhs
}
/// return the right-hand-side
#[inline]
pub(crate) fn return_rhs<Lhs, Rhs>(_: Lhs, rhs: Rhs) -> Rhs {
rhs
}
/// negate and return the right-hand-side
#[inline]
pub(crate) fn return_neg_rhs<Lhs, Rhs: Neg<Output = Rhs>>(
_: Lhs,
rhs: Rhs,
) -> Rhs {
-rhs
}
/// return zero
#[inline]
pub(crate) fn return_zero<Lhs, Rhs, Output: Zero>(_: Lhs, _: Rhs) -> Output {
Output::zero()
}
}

#[rustfmt::skip]
Expand Down
8 changes: 4 additions & 4 deletions ega/src/outermorphisms/matrix_4x4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ fn matrix4x4_morph_pseudo_scalar(
fn matrix4x4_morph_multivector(
m: Matrix4x4,
Multivector {
e0, e1, e2, e3,
s, e23, e31, e12,
e01, e02, e03, e0123,
e123, e032, e013, e021,
e0, e1, e2, e3,
s, e23, e31, e12,
e01, e02, e03, e0123,
e123, e032, e013, e021,
}: Multivector,
) -> Multivector {
let Vector { e0, e1, e2, e3 } =
Expand Down

0 comments on commit 3e33e0f

Please sign in to comment.