From 39885844a2b7c0fdf03e501379cdc9acd6cd6f30 Mon Sep 17 00:00:00 2001 From: Jan Wolff Date: Sun, 17 May 2020 13:04:49 +0200 Subject: [PATCH] cargo fmt :/ --- src/main.rs | 2 +- src/mime/mod.rs | 2 +- src/server/handler.rs | 2 +- src/server/mod.rs | 14 +++++++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index aa572bb..7f64e33 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ -mod server; mod mime; +mod server; use std::env; fn help() { diff --git a/src/mime/mod.rs b/src/mime/mod.rs index 4727f7e..6fc0f9f 100644 --- a/src/mime/mod.rs +++ b/src/mime/mod.rs @@ -9,7 +9,7 @@ pub fn get_mime_type(extension: &OsStr) -> &'static str { Some(ext_str) => ext_str, None => { return default_mime_type(); - }, + } }; match ext_str { diff --git a/src/server/handler.rs b/src/server/handler.rs index ec9b523..84d9d17 100644 --- a/src/server/handler.rs +++ b/src/server/handler.rs @@ -1,6 +1,6 @@ +use crate::mime; use crate::server::response; use crate::server::ServerConfig; -use crate::mime; use openssl::ssl::SslStream; use std::fs::File; use std::io::{copy, BufReader, BufWriter}; diff --git a/src/server/mod.rs b/src/server/mod.rs index f00ab35..643c15b 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,3 +1,4 @@ +use nix::unistd; use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; use std::net::{SocketAddr, TcpListener}; use std::path::PathBuf; @@ -5,7 +6,6 @@ use std::sync::Arc; use std::thread; use std::vec::Vec; use url::Url; -use nix::unistd; pub mod handler; pub mod response; @@ -96,13 +96,17 @@ impl Server { } match unistd::setgid(self.config.group) { - Ok(_) => {}, - Err(e) => {panic!(e);}, + Ok(_) => {} + Err(e) => { + panic!(e); + } }; match unistd::setuid(self.config.user) { - Ok(_) => {}, - Err(e) => {panic!(e);}, + Ok(_) => {} + Err(e) => { + panic!(e); + } }; for stream in listener.incoming() {