From d34bab6a26340ab254525fba117b1b1b06f96e2b Mon Sep 17 00:00:00 2001 From: Daniel Lehmann Date: Sun, 25 Aug 2024 00:46:19 -0700 Subject: [PATCH] Fix compile errors --- src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 601a66d..ef34ac0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,10 +40,8 @@ impl Display for TryNewError { } #[cfg_attr(feature = "const_convert_and_const_trait_impl", const_trait)] -pub trait Number: Sized { - type UnderlyingType: Copy - + Clone - + Number +pub trait Number: Sized + Copy + Clone { + type UnderlyingType: Number + Debug + From + TryFrom @@ -108,7 +106,7 @@ macro_rules! impl_number_native { fn value(self) -> Self::UnderlyingType { self } #[inline] - fn new_(value: T) -> Self { + fn new_(value: T) -> Self { match Self::BITS { 8 => value.as_u8() as Self, 16 => value.as_u16() as Self, @@ -120,7 +118,7 @@ macro_rules! impl_number_native { } #[inline] - fn masked_new(value: T) -> Self { + fn masked_new(value: T) -> Self { // Primitive types don't need masking Self::new_(value) }