From 7ee0e7faf63ddcea42dec001b2f698e779a5aa5e Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Wed, 25 May 2022 22:08:33 +0200 Subject: [PATCH] refactor: minor syntax/docs changes --- src/control_headers.rs | 2 -- src/custom_headers.rs | 2 +- src/server.rs | 6 +++--- src/winservice.rs | 2 ++ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/control_headers.rs b/src/control_headers.rs index 1fcfc4b..2512790 100644 --- a/src/control_headers.rs +++ b/src/control_headers.rs @@ -1,6 +1,4 @@ // An arbitrary `Cache-Control` headers functionality for incoming requests based on a set of file types. -// Note: Since it's an ad-hoc feature it could be subject to change in the future. -// See https://github.com/joseluisq/static-web-server/issues/30 use headers::{CacheControl, HeaderMapExt}; use hyper::{Body, Response}; diff --git a/src/custom_headers.rs b/src/custom_headers.rs index e6854c9..1cb4209 100644 --- a/src/custom_headers.rs +++ b/src/custom_headers.rs @@ -2,7 +2,7 @@ use hyper::{Body, Response}; use crate::settings::Headers; -/** Append custom HTTP headers to current response. */ +/// Append custom HTTP headers to current response. pub fn append_headers( uri: &str, headers_opts_vec: &Option>, diff --git a/src/server.rs b/src/server.rs index 4b4d650..f4bec7b 100644 --- a/src/server.rs +++ b/src/server.rs @@ -95,9 +95,9 @@ impl Server { addr_str = format!("@FD({})", fd); tcp_listener = ListenFd::from_env() .take_tcp_listener(fd)? - .with_context(|| "failed to convert inherited FD into a TCP listener")?; + .with_context(|| "failed to convert inherited 'fd' into a 'tcp' listener")?; tracing::info!( - "converted inherited file descriptor {} to a TCP listener", + "converted inherited file descriptor {} to a 'tcp' listener", fd ); } @@ -110,7 +110,7 @@ impl Server { tcp_listener = TcpListener::bind(addr) .with_context(|| format!("failed to bind to {} address", addr))?; addr_str = addr.to_string(); - tracing::info!("server bound to TCP socket {}", addr_str); + tracing::info!("server bound to tcp socket {}", addr_str); } } diff --git a/src/winservice.rs b/src/winservice.rs index 27a40ba..1a03308 100644 --- a/src/winservice.rs +++ b/src/winservice.rs @@ -1,3 +1,5 @@ +// Module that lets SWS to run as a "Windows Service" + use std::ffi::OsString; use std::thread; use std::time::Duration; -- libgit2 1.7.2