From 690990911ed9911ee2dd3dfd485faa0aae66c0d1 Mon Sep 17 00:00:00 2001 From: boasting-squirrel Date: Tue, 12 Feb 2019 20:25:44 +0100 Subject: Reorganized some imports + removed unused imports --- src/config.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 3d9971b..4873fff 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,4 +1,4 @@ -use actix_web::{fs, App, HttpRequest, Result}; +use actix_web::{fs, App}; use std::net::IpAddr; use crate::auth; @@ -52,11 +52,6 @@ pub fn configure_app(app: App) -> App { if let Some(s) = s { app.handler(&full_route, s) } else { - app.resource(&full_route, |r| r.f(file_handler)) + app.resource(&full_route, |r| r.f(listing::file_handler)) } } - -fn file_handler(req: &HttpRequest) -> Result { - let path = &req.state().path; - Ok(fs::NamedFile::open(path)?) -} -- cgit v1.2.3