From 02dd55df3972925ef6badf18725c0b446b1a737e Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Mon, 2 Oct 2017 17:11:18 +0200 Subject: [PATCH] Cleanup --- src/wiki_lookup.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/wiki_lookup.rs b/src/wiki_lookup.rs index c3388f9..f58ef02 100644 --- a/src/wiki_lookup.rs +++ b/src/wiki_lookup.rs @@ -11,36 +11,32 @@ use state::State; use web::{Lookup, Resource}; type BoxResource = Box; +type ResourceFn = Box BoxResource + Sync + Send>; lazy_static! { - static ref LOOKUP_MAP: HashMap BoxResource + Sync + Send>> = { + static ref LOOKUP_MAP: HashMap = { let mut lookup_map = HashMap::new(); lookup_map.insert( "/_new".to_string(), Box::new(|state| - Box::new( - NewArticleResource::new(state, None) - ) as BoxResource - ) as Box BoxResource + Sync + Send> + Box::new(NewArticleResource::new(state, None)) as BoxResource + ) as ResourceFn ); lookup_map.insert( format!("/_assets/style-{}.css", StyleCss::checksum()), - Box::new(|_| Box::new(StyleCss) as BoxResource) - as Box BoxResource + Sync + Send> + Box::new(|_| Box::new(StyleCss) as BoxResource) as ResourceFn ); lookup_map.insert( format!("/_assets/script-{}.js", ScriptJs::checksum()), - Box::new(|_| Box::new(ScriptJs) as BoxResource) - as Box BoxResource + Sync + Send> + Box::new(|_| Box::new(ScriptJs) as BoxResource) as ResourceFn ); lookup_map.insert( format!("/_assets/amatic-sc-v9-latin-regular.woff"), - Box::new(|_| Box::new(AmaticFont) as BoxResource) - as Box BoxResource + Sync + Send> + Box::new(|_| Box::new(AmaticFont) as BoxResource) as ResourceFn ); lookup_map