Rollup merge of #129675 - lolbinarycat:bufreader_peek_unsized, r=workingjubilee
allow BufReader::peek to be called on unsized types #128405
This commit is contained in:
commit
10fb626958
@ -94,7 +94,9 @@ pub fn new(inner: R) -> BufReader<R> {
|
|||||||
pub fn with_capacity(capacity: usize, inner: R) -> BufReader<R> {
|
pub fn with_capacity(capacity: usize, inner: R) -> BufReader<R> {
|
||||||
BufReader { inner, buf: Buffer::with_capacity(capacity) }
|
BufReader { inner, buf: Buffer::with_capacity(capacity) }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<R: Read + ?Sized> BufReader<R> {
|
||||||
/// Attempt to look ahead `n` bytes.
|
/// Attempt to look ahead `n` bytes.
|
||||||
///
|
///
|
||||||
/// `n` must be less than `capacity`.
|
/// `n` must be less than `capacity`.
|
||||||
|
Loading…
Reference in New Issue
Block a user