[−][src]Function fsio::file::read_text_file
pub fn read_text_file<T: AsPath + ?Sized>(path: &T) -> Result<String, FsIOError>
Reads the requested text file and returns its content.
Arguments
path
- The file path
Example
extern crate fsio; use crate::fsio::file; use std::path::Path; fn main() { let file_path = "./target/__test/file_test/write_text_file/file.txt"; let result = file::write_text_file(file_path, "some content"); assert!(result.is_ok()); let text = file::read_text_file(file_path).unwrap(); assert_eq!(text, "some content"); }