From 59a278e24a9ab890395fcf9765ca350b7f32fbee Mon Sep 17 00:00:00 2001 From: fiveseven-lambda Date: Fri, 20 Sep 2024 20:14:13 +0900 Subject: [PATCH] Update documentation for std::fs::read_to_string to reflect performance improvements on Windows --- library/std/src/fs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 92d3838d9f28f..e461791033edf 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -271,7 +271,8 @@ pub fn read>(path: P) -> io::Result> { /// Reads the entire contents of a file into a string. /// /// This is a convenience function for using [`File::open`] and [`read_to_string`] -/// with fewer imports and without an intermediate variable. +/// with fewer imports, without an intermediate variable, and with improved performance +/// by referencing the file's metadata to preallocate buffer size. /// /// [`read_to_string`]: Read::read_to_string ///