Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
w1th0utnam3 committed Dec 5, 2024
1 parent 919d3dc commit 7610c65
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions splashsurf_lib/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,21 @@ pub trait RealConvert: Sized {
}

impl<From: Real> RealConvert for &From {
type Out<To> = To where To: Real;
type Out<To>
= To
where
To: Real;

fn try_convert<To: Real>(self) -> Option<To> {
<To as NumCast>::from(*self)
}
}

impl<From: Real, const R: usize, const C: usize> RealConvert for SMatrix<From, R, C> {
type Out<To> = SMatrix<To, R, C> where To: Real;
type Out<To>
= SMatrix<To, R, C>
where
To: Real;

fn try_convert<To: Real>(self) -> Option<SMatrix<To, R, C>> {
let mut m_out: SMatrix<To, R, C> = SMatrix::zeros();
Expand Down

0 comments on commit 7610c65

Please sign in to comment.