From f24d1112dd4fe0f6cb24f3760e2d6a1c157bc45e Mon Sep 17 00:00:00 2001 From: James Date: Sun, 23 Jun 2019 21:55:16 +1000 Subject: [PATCH] Migrate assets to server module --- src/{ => frontend/rest}/assets.rs | 2 +- src/frontend/rest/mod.rs | 1 + src/frontend/rest/services/static_files.rs | 4 ++-- src/main.rs | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) rename src/{ => frontend/rest}/assets.rs (96%) diff --git a/src/assets.rs b/src/frontend/rest/assets.rs similarity index 96% rename from src/assets.rs rename to src/frontend/rest/assets.rs index 6350ba0..313d5df 100644 --- a/src/assets.rs +++ b/src/frontend/rest/assets.rs @@ -2,7 +2,7 @@ extern crate mime_guess; -use assets::mime_guess::{get_mime_type, octet_stream}; +use self::mime_guess::{get_mime_type, octet_stream}; macro_rules! include_files_as_assets { ( $target_match:expr, $( $file_name:expr ),* ) => { diff --git a/src/frontend/rest/mod.rs b/src/frontend/rest/mod.rs index 779767b..e10846d 100644 --- a/src/frontend/rest/mod.rs +++ b/src/frontend/rest/mod.rs @@ -2,5 +2,6 @@ //! //! Contains the main web server used within the application. +mod assets; pub mod server; pub mod services; diff --git a/src/frontend/rest/services/static_files.rs b/src/frontend/rest/services/static_files.rs index 16b8686..cac84af 100644 --- a/src/frontend/rest/services/static_files.rs +++ b/src/frontend/rest/services/static_files.rs @@ -4,6 +4,8 @@ //! //! e.g. index.html, main.js, ... +use frontend::rest::assets; + use frontend::rest::services::default_future; use frontend::rest::services::Future; use frontend::rest::services::Request; @@ -15,8 +17,6 @@ use hyper::StatusCode; use logging::LoggingErrors; -use assets; - pub fn handle(_service: &WebService, req: Request) -> Future { // At this point, we have a web browser client. Search for a index page // if needed diff --git a/src/main.rs b/src/main.rs index 84ac684..ca2ba2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,6 @@ extern crate slug; extern crate sysinfo; mod archives; -mod assets; mod config; mod frontend; mod http;