summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Wolff <janw@mailbox.org>2020-05-17 13:04:49 +0200
committerJan Wolff <janw@mailbox.org>2020-05-17 13:04:49 +0200
commit39885844a2b7c0fdf03e501379cdc9acd6cd6f30 (patch)
treee06ec857b04af4323444b76837de8c4a8f81f15c
parent37769d653626008189b575b226b2fc0a0faac800 (diff)
cargo fmt :/
-rw-r--r--src/main.rs2
-rw-r--r--src/mime/mod.rs2
-rw-r--r--src/server/handler.rs2
-rw-r--r--src/server/mod.rs14
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() {