Skip to content

Commit 678ea51

Browse files
authored
Merge pull request #6 from cuviper/super-bytes
Add supertraits to `PrimitiveNumber::Bytes`
2 parents 4a34b7e + 362533d commit 678ea51

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/number.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,23 @@ pub trait PrimitiveNumber:
102102
{
103103
/// An array of bytes used by methods like [`from_be_bytes`][Self::from_be_bytes] and
104104
/// [`to_be_bytes`][Self::to_be_bytes]. It is effectively `[u8; size_of::<Self>()]`.
105-
type Bytes: core::borrow::Borrow<[u8]> + core::borrow::BorrowMut<[u8]>;
105+
type Bytes: 'static
106+
+ core::borrow::Borrow<[u8]>
107+
+ core::borrow::BorrowMut<[u8]>
108+
+ core::cmp::Eq
109+
+ core::cmp::Ord
110+
+ core::cmp::PartialEq<[u8]>
111+
+ core::convert::AsRef<[u8]>
112+
+ core::convert::AsMut<[u8]>
113+
+ core::default::Default
114+
+ core::fmt::Debug
115+
+ core::hash::Hash
116+
+ core::marker::Copy
117+
+ core::marker::Send
118+
+ core::marker::Sync
119+
+ core::marker::Unpin
120+
+ core::panic::RefUnwindSafe
121+
+ core::panic::UnwindSafe;
106122

107123
/// Creates a number from its representation as a byte array in big endian.
108124
fn from_be_bytes(bytes: Self::Bytes) -> Self;

0 commit comments

Comments
 (0)