From 8623fa49bacec0e5a83dc14586a44423107d4018 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 --- std/src/io/buffered/bufreader.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/std/src/io/buffered/bufreader.rs b/std/src/io/buffered/bufreader.rs index 0b12e5777c840..cf226bd28d005 100644 --- a/std/src/io/buffered/bufreader.rs +++ b/std/src/io/buffered/bufreader.rs @@ -94,7 +94,9 @@ impl 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`.