From ae6f8a7764bd69217f3d0f2ea5e98b9b8a18ad7e Mon Sep 17 00:00:00 2001 From: binarycat Date: Tue, 27 Aug 2024 21:51:37 -0400 Subject: [PATCH] allow BufReader::peek to be called on unsized types --- library/std/src/io/buffered/bufreader.rs | 2 ++ 1 file changed, 2 insertions(+) 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 @@ pub fn new(inner: R) -> BufReader { pub fn with_capacity(capacity: usize, inner: R) -> BufReader { BufReader { inner, buf: Buffer::with_capacity(capacity) } } +} +impl BufReader { /// Attempt to look ahead `n` bytes. /// /// `n` must be less than `capacity`.