index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2022-05-25 20:08:33.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2022-05-25 20:08:33.0 +00:00:00
commit
7ee0e7faf63ddcea42dec001b2f698e779a5aa5e [patch]
tree
24df5a98555814fcbe4b2c360199d8e91362f256
parent
b49395adc47afa3334fa3292964c7ddec46cf5ec
download
7ee0e7faf63ddcea42dec001b2f698e779a5aa5e.tar.gz

refactor: minor syntax/docs changes



Diff

 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<Vec<Headers>>,
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;