From 851d5c2eef612effbec881f5e6680737202368bd Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Fri, 27 Oct 2023 09:23:20 +0200 Subject: [PATCH] doc: add doc string and change some path with the fortcihe path --- Cargo.toml | 4 ++-- src/lib.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0b742fc..6280d58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,8 @@ authors = ["Philippe Llerena"] description = "A web server to deliver basic File System informations" readme = "README.md" license-file = "LICENSE" -documentation = "https://github.com/doubleailes/quiet-stroll/blob/main/README.md" -repository = "https://github.com/doubleailes/quiet-stroll" +documentation = "https://github.com/forticheprod/quiet-stroll/blob/main/README.md" +repository = "https://github.com/forticheprod/quiet-stroll" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/lib.rs b/src/lib.rs index 9aadc6e..21f9490 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,6 +87,7 @@ impl QuietPaths { paths_list: get_walk(input_path.input_path.as_str()), } } + /// Create a QuietPaths from a get_walk function pub fn to_paths(&self) -> Paths { let data: Vec = self .paths_list @@ -95,6 +96,7 @@ impl QuietPaths { .collect::>(); Paths::new(data) } + /// Create a QuietPaths from a get_walk function pub fn from_paths(paths: Paths) -> Self { let paths_list: Vec = paths .par_iter() @@ -104,9 +106,12 @@ impl QuietPaths { paths_list: paths_list, } } + /// Pack a quiet path to a basic listing using framels lib pub fn packed(&self) -> Self { QuietPaths::from_paths(basic_listing(self.to_paths()).get_paths()) } + /// create a QuietPaths from a string + /// mainly for testing purpose pub fn from_string(s: String) -> Self { QuietPaths { paths_list: vec![s],