File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 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 {
776776 // Reserves space in the buffer based on the file size when available.
777777 fn read_to_end ( & mut self , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
778778 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 ) ?;
780780 io:: default_read_to_end ( self , buf, size)
781781 }
782782
783783 // Reserves space in the buffer based on the file size when available.
784784 fn read_to_string ( & mut self , buf : & mut String ) -> io:: Result < usize > {
785785 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 ) ?;
787787 io:: default_read_to_string ( self , buf, size)
788788 }
789789}
You can’t perform that action at this time.
0 commit comments