Skip to content

Commit

Permalink
rustfmt again
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillFish8 committed May 28, 2021
1 parent 9ea8a60 commit a34c2fc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ use crate::context::{ImageFormat, ImageGet, ImageRemove};
use crate::storage::{Backend, DatabaseBackend, StorageBackend};
use crate::traits::DatabaseLinker;


static UUID_REGEX: &str = "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$";

static UUID_REGEX: &str =
"^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$";

#[derive(Deserialize, StateData, StaticResponseExtender)]
struct PathExtractor {
Expand All @@ -55,19 +54,15 @@ fn router(backend: storage::StorageBackend, config: StateConfig) -> Result<Route

Ok(build_router(chain, pipelines, |route| {
route
.get(&format!(
"{}/:file_id:{}",
base,
UUID_REGEX,
))
.get(&format!("{}/:file_id:{}", base, UUID_REGEX,))
.with_path_extractor::<PathExtractor>()
.with_query_string_extractor::<ImageGet>()
.to_async(routes::get_file);

route.post("admin/create").to_async(routes::add_file);

route
.delete(&format!("admin/delete/:file_id:{}",UUID_REGEX))
.delete(&format!("admin/delete/:file_id:{}", UUID_REGEX))
.with_path_extractor::<ImageRemove>()
.to_async(routes::remove_file);
}))
Expand Down

0 comments on commit a34c2fc

Please sign in to comment.