Skip to content

Commit

Permalink
Fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danlehmann committed Aug 25, 2024
1 parent 35b1079 commit d34bab6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>
+ TryFrom<u16>
Expand Down Expand Up @@ -108,7 +106,7 @@ macro_rules! impl_number_native {
fn value(self) -> Self::UnderlyingType { self }

#[inline]
fn new_<T: Number>(value: T) -> Self {
fn new_<T: ~const Number>(value: T) -> Self {
match Self::BITS {
8 => value.as_u8() as Self,
16 => value.as_u16() as Self,
Expand All @@ -120,7 +118,7 @@ macro_rules! impl_number_native {
}

#[inline]
fn masked_new<T: Number>(value: T) -> Self {
fn masked_new<T: ~const Number>(value: T) -> Self {
// Primitive types don't need masking
Self::new_(value)
}
Expand Down

0 comments on commit d34bab6

Please sign in to comment.