refactored cli and logging
All checks were successful
Test the running changes / Test (push) Successful in 41s
All checks were successful
Test the running changes / Test (push) Successful in 41s
This commit is contained in:
@@ -29,7 +29,7 @@ mod response;
|
||||
///
|
||||
/// # Panics
|
||||
/// Never. Added to allow compiler to check for ! type.
|
||||
pub fn serve(addr: Ipv4Addr, port: u16, dir: PathBuf) -> Result<!, Error> {
|
||||
pub fn serve(addr: Ipv4Addr, port: u16, dir: PathBuf) -> Result<(), Error> {
|
||||
/*
|
||||
let args: ProgramArgs = std::env::args().try_into()?;
|
||||
|
||||
@@ -88,6 +88,5 @@ pub fn serve(addr: Ipv4Addr, port: u16, dir: PathBuf) -> Result<!, Error> {
|
||||
Err(e) => log!(Level::Warn, "Connection failed: {}", e),
|
||||
}
|
||||
}
|
||||
|
||||
panic!("Code shouldn't get to here");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -110,6 +110,14 @@ impl TryFrom<&mut BufReader<&TcpStream>> for HttpRequest {
|
||||
}
|
||||
}
|
||||
|
||||
log!(
|
||||
Level::Info,
|
||||
"{} /{} {}",
|
||||
req.method,
|
||||
req.path.display(),
|
||||
req.version
|
||||
);
|
||||
|
||||
Ok(req)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user