Skip to content

Commit

Permalink
Automatically fix lint failures and format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Upload lint fixes from CI committed Dec 18, 2023
1 parent ecaa83f commit 4f54897
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::path::PathBuf;
use clap::{Parser, Subcommand};
use std::path::PathBuf;

mod server;

Expand Down
7 changes: 3 additions & 4 deletions src/server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::PathBuf;
use std::convert::Infallible;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::time::Duration;

use http_body_util::Full;
Expand All @@ -16,15 +16,14 @@ async fn hello(_: Request<hyper::body::Incoming>) -> Result<Response<Full<Bytes>
Ok(Response::new(Full::new(Bytes::from("Hello, World!"))))
}

pub async fn serve(script: &PathBuf) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
pub async fn serve(_script: &PathBuf) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));

// Use a 5 second timeout for incoming connections to the server.
// If a request is in progress when the 5 second timeout elapses,
// use a 2 second timeout for processing the final request and graceful shutdown.
let connection_timeouts = vec![Duration::from_secs(5), Duration::from_secs(2)];


// We create a TcpListener and bind it to 127.0.0.1:3000
let listener = TcpListener::bind(addr).await?;

Expand Down Expand Up @@ -71,4 +70,4 @@ pub async fn serve(script: &PathBuf) -> Result<(), Box<dyn std::error::Error + S
}
});
}
}
}

0 comments on commit 4f54897

Please sign in to comment.