diff --git a/src/lib.rs b/src/lib.rs index 334a3f8..d350660 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ use std::fs::File; use std::io::Result; -use std::path::PathBuf; +use std::path::Path; extern crate log; extern crate simplelog; @@ -69,6 +69,18 @@ pub fn init() -> std::result::Result<(), log::SetLoggerError> { } /// Import user input from a text file and return them as a String -pub fn import_input(path: PathBuf) -> Result { +/// +/// # Arguments +/// +/// * `path` - path to the file containing the user input +/// +/// # Example +/// +/// ```no_run +/// # use lang_evolve_core::import_input; +/// use std::path::Path; +/// let _input = import_input(Path::new("input.txt")).unwrap(); +/// ``` +pub fn import_input(path: &Path) -> Result { utils::read_file(&path) }