diff --git a/Cargo.toml b/Cargo.toml index 1bb5a66..7e726f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ serde_json = "1.0.91" glob = "0.3.1" schemars = "0.8.10" framels = "0.4.0-rc.3" +rayon = "1.7.0" [dependencies.rocket] version = "0.5.0-rc.3" diff --git a/src/lib.rs b/src/lib.rs index 1e5ff1c..9abb4ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ use rocket::serde::{json::Json, Deserialize, Serialize}; use rocket_okapi::okapi::schemars; use rocket_okapi::okapi::schemars::JsonSchema; use std::fs; +use rayon::prelude::*; /// get_walk is a function to walk the content of a directory and his /// subfolders diff --git a/src/main.rs b/src/main.rs index b5db454..d4eafa6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,16 +62,16 @@ fn fwalk(input_path: Json, packed: Option) -> Json } #[openapi(tag = "FileSystem")] #[post("/walk/", format = "application/json", data = "")] -fn fwalk_os(input_path: Json, n: String) -> Json { +fn fwalk_os(input_path: Json, n: String) -> Json { if n == "windows" { let path = InputPath::convert_to_unix(input_path); - Json(Paths::from_walk(path)) + Json(QuietPaths::from_walk(path)) } else { - Json(Paths::from_walk(input_path)) + Json(QuietPaths::from_walk(input_path)) } } #[openapi(tag = "FileSystem")] -#[post("/listdir", format = "application/json", data = "")] +#[post("/listdir?", format = "application/json", data = "")] /// # listdir /// /// ## Description