File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -776,14 +776,14 @@ impl Read for &File {
776
776
// Reserves space in the buffer based on the file size when available.
777
777
fn read_to_end ( & mut self , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
778
778
let size = buffer_capacity_required ( self ) ;
779
- buf. try_reserve_exact ( size. unwrap_or ( 0 ) ) . map_err ( |_| io:: ErrorKind :: OutOfMemory ) ?;
779
+ buf. try_reserve ( size. unwrap_or ( 0 ) ) . map_err ( |_| io:: ErrorKind :: OutOfMemory ) ?;
780
780
io:: default_read_to_end ( self , buf, size)
781
781
}
782
782
783
783
// Reserves space in the buffer based on the file size when available.
784
784
fn read_to_string ( & mut self , buf : & mut String ) -> io:: Result < usize > {
785
785
let size = buffer_capacity_required ( self ) ;
786
- buf. try_reserve_exact ( size. unwrap_or ( 0 ) ) . map_err ( |_| io:: ErrorKind :: OutOfMemory ) ?;
786
+ buf. try_reserve ( size. unwrap_or ( 0 ) ) . map_err ( |_| io:: ErrorKind :: OutOfMemory ) ?;
787
787
io:: default_read_to_string ( self , buf, size)
788
788
}
789
789
}
You can’t perform that action at this time.
0 commit comments