From 405f9735fcfaeb42d6d3ccc13846fe66fc2a6cae Mon Sep 17 00:00:00 2001 From: Mirus Date: Wed, 20 Dec 2023 21:42:56 +0800 Subject: [PATCH] chore(fmt): cargo fmt --- src/lib.rs | 2 +- src/server.rs | 5 ++++- tests/test.rs | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 613c148..fcc59f7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ pub async fn listen>( host: &str, port: u16, root: R, - try_to_switch_to_an_available_port: bool + try_to_switch_to_an_available_port: bool, ) -> Result<(), Box> { HOST.set(host.to_string()).unwrap(); ROOT.set(root.into()).unwrap(); diff --git a/src/server.rs b/src/server.rs index 4eacbc0..469f9cd 100644 --- a/src/server.rs +++ b/src/server.rs @@ -21,7 +21,10 @@ pub async fn serve(port: u16, switch_to_available_ports: bool) -> Result<(), Str Ok(()) } -async fn create_listener(port: u16, switch_to_available_ports: bool) -> Result { +async fn create_listener( + port: u16, + switch_to_available_ports: bool, +) -> Result { let host = HOST.get().unwrap(); let mut port = port; // Loop until the port is available diff --git a/tests/test.rs b/tests/test.rs index 881da9f..41e6aff 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -4,7 +4,9 @@ use reqwest::StatusCode; #[tokio::test] async fn request() { tokio::spawn(async { - listen("127.0.0.1", 8000, "./tests/page", false).await.unwrap(); + listen("127.0.0.1", 8000, "./tests/page", false) + .await + .unwrap(); }); // Test requesting index.html