runs rustfmt, removes unused imports

This commit is contained in:
2019-06-18 15:49:10 +02:00
parent 9b3df58a08
commit f619f7229b
4 changed files with 33 additions and 37 deletions

View File

@@ -1,12 +1,9 @@
extern crate lootalot_db;
extern crate actix_web;
extern crate dotenv;
extern crate lootalot_db;
use actix_web::{fs, server, App, HttpRequest, Result};
use std::env;
use std::cell::RefCell;
use std::rc::Rc;
use actix_web::{server, App, Result, HttpRequest, fs };
fn main() {
println!("Hello, world!");
@@ -16,10 +13,14 @@ fn main() {
let www_root: String = env::var("WWW_ROOT").expect("WWW_ROOT must be set");
println!("serving files from: {}", &www_root);
server::new(move || {
App::new()
.handler("/", fs::StaticFiles::new(www_root.clone()).unwrap().index_file("index.html"))
App::new().handler(
"/",
fs::StaticFiles::new(www_root.clone())
.unwrap()
.index_file("index.html"),
)
})
.bind("127.0.0.1:8088")
.unwrap()
.run();
.bind("127.0.0.1:8088")
.unwrap()
.run();
}