From c6b2418a49982e7d8a7bd6afa07891cbeaf82a6b Mon Sep 17 00:00:00 2001 From: _ <> Date: Sun, 21 Mar 2021 03:40:45 +0000 Subject: [PATCH] :recycle: refactor: split up large function at clippy's behest --- crates/ptth_server/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ptth_server/src/lib.rs b/crates/ptth_server/src/lib.rs index bb5e852..e3982c6 100644 --- a/crates/ptth_server/src/lib.rs +++ b/crates/ptth_server/src/lib.rs @@ -194,7 +194,6 @@ pub async fn run_server ( }; use arc_swap::ArcSwap; - use http::status::StatusCode; let asset_root = asset_root.unwrap_or_else (PathBuf::new); @@ -238,6 +237,15 @@ pub async fn run_server ( client, }); + run_server_loop (state, shutdown_oneshot).await +} + +async fn run_server_loop ( + state: Arc , + shutdown_oneshot: oneshot::Receiver <()>, +) -> Result <(), ServerError> { + use http::status::StatusCode; + let mut backoff_delay = 0; let mut shutdown_oneshot = shutdown_oneshot.fuse ();