File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
library/std/src/io/buffered Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ impl<R: Read> BufReader<R> {
9494 pub fn with_capacity ( capacity : usize , inner : R ) -> BufReader < R > {
9595 BufReader { inner, buf : Buffer :: with_capacity ( capacity) }
9696 }
97+ }
9798
99+ impl < R : Read + ?Sized > BufReader < R > {
98100 /// Attempt to look ahead `n` bytes.
99101 ///
100102 /// `n` must be less than `capacity`.
@@ -117,7 +119,10 @@ impl<R: Read> BufReader<R> {
117119 /// assert_eq!(&s, "hello");
118120 /// ```
119121 #[ unstable( feature = "bufreader_peek" , issue = "128405" ) ]
120- pub fn peek ( & mut self , n : usize ) -> io:: Result < & [ u8 ] > {
122+ pub fn peek ( & mut self , n : usize ) -> io:: Result < & [ u8 ] >
123+ where
124+ R : ?Sized ,
125+ {
121126 assert ! ( n <= self . capacity( ) ) ;
122127 while n > self . buf . buffer ( ) . len ( ) {
123128 if self . buf . pos ( ) > 0 {
You can’t perform that action at this time.
0 commit comments