read_file

Function read_file 

Source
pub fn read_file(directory: &str, file_name: &str) -> Result<String>
Expand description

Reads the content of a file in a specific directory and returns it as a string.

§Arguments

  • directory - The path to the directory where the file is located.
  • file_name - The name of the file to read.

§Returns

  • Ok(String) containing the file’s content.
  • Err(io::Error) if an error occurs.