allow BufReader::peek to be called on unsized types

This commit is contained in:
binarycat 2024-08-27 21:51:37 -04:00
parent 600edc948a
commit ae6f8a7764

View File

@ -94,7 +94,9 @@ impl<R: Read> BufReader<R> {
pub fn with_capacity(capacity: usize, inner: R) -> BufReader<R> {
BufReader { inner, buf: Buffer::with_capacity(capacity) }
}
}
impl<R: Read + ?Sized> BufReader<R> {
/// Attempt to look ahead `n` bytes.
///
/// `n` must be less than `capacity`.