Skip to content

Commit

Permalink
add rayon
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleailes committed Jul 19, 2023
1 parent 6abed52 commit 8b7c251
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ fn fwalk(input_path: Json<InputPath>, packed: Option<bool>) -> Json<QuietPaths>
}
#[openapi(tag = "FileSystem")]
#[post("/walk/<n>", format = "application/json", data = "<input_path>")]
fn fwalk_os(input_path: Json<InputPath>, n: String) -> Json<Paths> {
fn fwalk_os(input_path: Json<InputPath>, n: String) -> Json<QuietPaths> {
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 = "<input_path>")]
#[post("/listdir?<packed>", format = "application/json", data = "<input_path>")]
/// # listdir
///
/// ## Description
Expand Down

0 comments on commit 8b7c251

Please sign in to comment.