Skip to content

Commit

Permalink
chore: cargo fmt & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
lomirus committed Dec 18, 2023
1 parent 1f7f4fb commit 0058ee1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct Args {
#[clap(default_value = ".")]
root: String,
/// Set the listener host [default: LAN IP address]
#[clap(short='s', long)]
#[clap(short = 's', long)]
host: Option<String>,
/// Set the listener port
#[clap(short, long, default_value_t = 8000)]
Expand Down
6 changes: 1 addition & 5 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ async fn static_assets(
log::warn!("{}", err);
if mime == "text/html" {
let script = format!(include_str!("templates/websocket.html"), host, port);
let html = format!(
include_str!("templates/error.html"),
script,
err.to_string()
);
let html = format!(include_str!("templates/error.html"), script, err);
response.set_body(Body::from_string(html));
if err.kind() == ErrorKind::NotFound {
response.set_status(StatusCode::NotFound);
Expand Down

0 comments on commit 0058ee1

Please sign in to comment.