diff options
| author | binarycat <binarycat@envs.net> | 2024-08-27 21:51:37 -0400 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2024-08-28 13:56:44 -0400 |
| commit | ae6f8a7764bd69217f3d0f2ea5e98b9b8a18ad7e (patch) | |
| tree | 1a3c50da23fbade648db31ef3a8931aa9ae44090 | |
| parent | 600edc948ab5de7a92538bcc2f49cb8d47925e2d (diff) | |
| download | rust-ae6f8a7764bd69217f3d0f2ea5e98b9b8a18ad7e.tar.gz rust-ae6f8a7764bd69217f3d0f2ea5e98b9b8a18ad7e.zip | |
allow BufReader::peek to be called on unsized types
| -rw-r--r-- | library/std/src/io/buffered/bufreader.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/io/buffered/bufreader.rs b/library/std/src/io/buffered/bufreader.rs index 0b12e5777c8..cf226bd28d0 100644 --- a/library/std/src/io/buffered/bufreader.rs +++ b/library/std/src/io/buffered/bufreader.rs @@ -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`. |
