Skip to content

Commit bbeeaa2

Browse files
committed
Allow FromBytes::Bytes to be unsized
1 parent c89a430 commit bbeeaa2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ops/bytes.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub trait NumBytes:
1616
+ Hash
1717
+ Borrow<[u8]>
1818
+ BorrowMut<[u8]>
19-
+ Default
2019
{
2120
}
2221

@@ -31,7 +30,7 @@ impl<T> NumBytes for T where
3130
+ Hash
3231
+ Borrow<[u8]>
3332
+ BorrowMut<[u8]>
34-
+ Default
33+
+ ?Sized
3534
{
3635
}
3736

@@ -94,7 +93,7 @@ pub trait ToBytes {
9493
}
9594

9695
pub trait FromBytes: Sized {
97-
type Bytes: NumBytes;
96+
type Bytes: NumBytes + ?Sized;
9897

9998
/// Create a number from its representation as a byte array in big endian.
10099
///

0 commit comments

Comments
 (0)