pub fn read_file_to_string(path: &Path, max_file_size: u64) -> Result<String>Expand description
Read a text file as a string using the optimal reading strategy
This function reads a file as text, using the most efficient strategy based on the file size.
§Arguments
path- Path to the file to readmax_file_size- Maximum allowed file size
§Returns
A string containing the file contents
§Errors
Returns an error if the file cannot be read or exceeds the size limit