diff --git a/src/main.rs b/src/main.rs index 8a3a5e8..7a9c327 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,18 +23,14 @@ extern crate titlecase; use std::net::SocketAddr; -mod article_redirect_resource; -mod article_resource; mod assets; -mod changes_resource; mod db; mod mimes; mod models; -mod new_article_resource; mod rendering; +mod resources; mod schema; mod site; -mod sitemap_resource; mod state; mod web; mod wiki_lookup; diff --git a/src/article_redirect_resource.rs b/src/resources/article_redirect_resource.rs similarity index 100% rename from src/article_redirect_resource.rs rename to src/resources/article_redirect_resource.rs diff --git a/src/article_resource.rs b/src/resources/article_resource.rs similarity index 100% rename from src/article_resource.rs rename to src/resources/article_resource.rs diff --git a/src/changes_resource.rs b/src/resources/changes_resource.rs similarity index 100% rename from src/changes_resource.rs rename to src/resources/changes_resource.rs diff --git a/src/resources/mod.rs b/src/resources/mod.rs new file mode 100644 index 0000000..16d481c --- /dev/null +++ b/src/resources/mod.rs @@ -0,0 +1,11 @@ +mod article_redirect_resource; +mod article_resource; +mod changes_resource; +mod new_article_resource; +mod sitemap_resource; + +pub use self::article_redirect_resource::ArticleRedirectResource; +pub use self::article_resource::ArticleResource; +pub use self::changes_resource::ChangesResource; +pub use self::new_article_resource::NewArticleResource; +pub use self::sitemap_resource::SitemapResource; diff --git a/src/new_article_resource.rs b/src/resources/new_article_resource.rs similarity index 100% rename from src/new_article_resource.rs rename to src/resources/new_article_resource.rs diff --git a/src/sitemap_resource.rs b/src/resources/sitemap_resource.rs similarity index 100% rename from src/sitemap_resource.rs rename to src/resources/sitemap_resource.rs diff --git a/src/wiki_lookup.rs b/src/wiki_lookup.rs index 4f9a293..2a32dc6 100644 --- a/src/wiki_lookup.rs +++ b/src/wiki_lookup.rs @@ -3,11 +3,8 @@ use std::collections::HashMap; use futures::{Future, finished, failed}; use percent_encoding::percent_decode; -use article_redirect_resource::ArticleRedirectResource; -use article_resource::ArticleResource; +use resources::*; use assets::*; -use new_article_resource::NewArticleResource; -use sitemap_resource::SitemapResource; use state::State; use web::{Lookup, Resource}; @@ -18,8 +15,6 @@ lazy_static! { static ref LOOKUP_MAP: HashMap = { let mut lookup_map = HashMap::new(); - use changes_resource::ChangesResource; - lookup_map.insert( "/_changes".to_string(), Box::new(|state: &State|