Skip to content

Commit 060ef26

Browse files
committed
Do not require know size at compile time
The `Base32Len` and `ToBase32` traits currently require the implementing type to have a known size at compile time. This is an unnecessary restriction. Fix: #82
1 parent f33d2b0 commit 060ef26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub trait Base32Len: ToBase32 {
269269
}
270270

271271
#[cfg(feature = "alloc")]
272-
impl<T: AsRef<[u8]>> ToBase32 for T {
272+
impl<T: AsRef<[u8]> + ?Sized> ToBase32 for T {
273273
fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> {
274274
// Amount of bits left over from last round, stored in buffer.
275275
let mut buffer_bits = 0u32;
@@ -314,7 +314,7 @@ impl<T: AsRef<[u8]>> ToBase32 for T {
314314
}
315315

316316
#[cfg(feature = "alloc")]
317-
impl<T: AsRef<[u8]>> Base32Len for T {
317+
impl<T: AsRef<[u8]> + ?Sized> Base32Len for T {
318318
fn base32_len(&self) -> usize {
319319
let bits = self.as_ref().len() * 8;
320320
if bits % 5 == 0 {

0 commit comments

Comments
 (0)