From c3bb122d1f364b99f6035834a534e7a2e2cb586c Mon Sep 17 00:00:00 2001 From: Kieran Moy Date: Mon, 22 Jul 2024 16:29:37 +0800 Subject: [PATCH] update main.rs --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7d5214b..ac41701 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use tsr::{ use chrono::{DateTime, Utc}; use clap::Parser; use mime::Mime; -use std::{collections::HashMap, env, error::Error, ops::Deref, path::Path}; +use std::{collections::HashMap, env, error::Error, io, ops::Deref, path::Path}; #[cfg(feature = "log")] use log::log; @@ -84,7 +84,7 @@ impl<'a> Response<'a> { } } -async fn handle_connection(mut stream: TcpStream) -> Result<(i32, String), Box> { +async fn handle_connection(mut stream: TcpStream) -> io::Result<(i32, String)> { let config = CONFIG.deref(); let mut response: Response = Response { @@ -112,7 +112,9 @@ async fn handle_connection(mut stream: TcpStream) -> Result<(i32, String), Box