From c4a2778af1b13921aa47d96600e2a7c8c9eb8ac5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 30 Sep 2024 17:08:46 -0700 Subject: [PATCH] explicitly implement From for specific types --- fixed_wide/src/fixed.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 852ccff..985d530 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -70,15 +70,22 @@ impl Fixed<1,F>{ } } -impl From for Fixed - where - BInt:From -{ - #[inline] - fn from(value:T)->Self{ - Self::from_bits(BInt::<{N}>::from(value)<{ + $( + impl From<$from> for Fixed{ + #[inline] + fn from(value:$from)->Self{ + Self::from_bits(BInt::<{N}>::from(value)< PartialEq for Fixed{ #[inline]