Skip to content

Commit 5c73cac

Browse files
Implementing read_buf directly is basically impossible now, so we don't
1 parent 335df84 commit 5c73cac

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
const_mut_refs,
4343
const_precise_live_drops,
4444
const_ptr_is_null,
45-
const_ptr_offset_from,
4645
const_ptr_read,
4746
const_ptr_write,
4847
// this should be called `const_interior_mutability` IMO

src/trait_impls.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@ use crate::StaticVec;
1919
#[cfg(feature = "std")]
2020
use core::str;
2121

22-
#[cfg(feature = "std")]
23-
use crate::utils::const_min;
24-
2522
#[cfg(feature = "std")]
2623
use alloc::string::String;
2724

2825
#[cfg(feature = "std")]
2926
use alloc::vec::Vec;
3027

3128
#[cfg(feature = "std")]
32-
use std::io::{self, BufRead, IoSlice, IoSliceMut, Read, ReadBuf};
29+
use std::io::{self, BufRead, IoSlice, IoSliceMut, Read};
3330

3431
#[cfg(feature = "serde")]
3532
use core::marker::PhantomData;
@@ -887,16 +884,6 @@ impl<const N: usize> Read for StaticVec<u8, N> {
887884
}
888885
Ok(total_read)
889886
}
890-
891-
#[inline]
892-
fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> io::Result<()> {
893-
// Here we directly adapt the implementation from &[u8].
894-
let amount = const_min(buf.remaining(), self.len());
895-
let b = self.split_off(amount);
896-
buf.append(&self);
897-
*self = b;
898-
Ok(())
899-
}
900887
}
901888

902889
impl<const N: usize> fmt::Write for StaticVec<u8, N> {

0 commit comments

Comments
 (0)