Function tmx_utils::string_ext::read_local_file
source · pub fn read_local_file(path: &str) -> Result<String, Error>Expand description
Reads a file from the current directory. Returns io errors or an error if the line is empty.
Examples
let e = read_local_file("read_local_file.txt").unwrap_err();
println!("{}", e.kind());
assert_eq!(e.kind(), std::io::ErrorKind::NotFound); //Not a valid pathlet e = read_local_file("src/main.rs").unwrap();
assert!(e.len() > 0);