cargo fmt :/

This commit is contained in:
Jan Wolff 2020-05-17 13:04:49 +02:00
parent 37769d6536
commit 39885844a2
4 changed files with 12 additions and 8 deletions

View file

@ -1,5 +1,5 @@
mod server;
mod mime;
mod server;
use std::env;
fn help() {

View file

@ -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 {

View file

@ -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};

View file

@ -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() {