From e9a161f5260590408c9ca8ee65817606f0b20be9 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 28 Mar 2020 21:58:27 +0100 Subject: [PATCH] Updated `import_input` signature, documentation --- src/lib.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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) }