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 mime;
mod server;
use std::env; use std::env;
fn help() { fn help() {

View file

@ -9,7 +9,7 @@ pub fn get_mime_type(extension: &OsStr) -> &'static str {
Some(ext_str) => ext_str, Some(ext_str) => ext_str,
None => { None => {
return default_mime_type(); return default_mime_type();
}, }
}; };
match ext_str { match ext_str {

View file

@ -1,6 +1,6 @@
use crate::mime;
use crate::server::response; use crate::server::response;
use crate::server::ServerConfig; use crate::server::ServerConfig;
use crate::mime;
use openssl::ssl::SslStream; use openssl::ssl::SslStream;
use std::fs::File; use std::fs::File;
use std::io::{copy, BufReader, BufWriter}; use std::io::{copy, BufReader, BufWriter};

View file

@ -1,3 +1,4 @@
use nix::unistd;
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
use std::net::{SocketAddr, TcpListener}; use std::net::{SocketAddr, TcpListener};
use std::path::PathBuf; use std::path::PathBuf;
@ -5,7 +6,6 @@ use std::sync::Arc;
use std::thread; use std::thread;
use std::vec::Vec; use std::vec::Vec;
use url::Url; use url::Url;
use nix::unistd;
pub mod handler; pub mod handler;
pub mod response; pub mod response;
@ -96,13 +96,17 @@ impl Server {
} }
match unistd::setgid(self.config.group) { match unistd::setgid(self.config.group) {
Ok(_) => {}, Ok(_) => {}
Err(e) => {panic!(e);}, Err(e) => {
panic!(e);
}
}; };
match unistd::setuid(self.config.user) { match unistd::setuid(self.config.user) {
Ok(_) => {}, Ok(_) => {}
Err(e) => {panic!(e);}, Err(e) => {
panic!(e);
}
}; };
for stream in listener.incoming() { for stream in listener.incoming() {