From abc5085577768e939769ca38619dc9158e60aaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Fri, 19 Apr 2024 19:19:08 +0800 Subject: [PATCH] fix: remove lifetime for socket --- src/models/client.rs | 2 +- src/models/mod.rs | 2 +- src/utils/gear.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/client.rs b/src/models/client.rs index 2d355a4..303c940 100644 --- a/src/models/client.rs +++ b/src/models/client.rs @@ -168,7 +168,7 @@ impl Request { Ok(()) } - pub async fn send_header(&mut self) -> Result<(), OblivionException> { + pub async fn send_header(&mut self) -> Result<()> { let tcp = self.tcp.as_mut().unwrap(); let header = self.plain_text.as_bytes().to_vec(); tcp.send(&length(&header)?).await?; diff --git a/src/models/mod.rs b/src/models/mod.rs index 527208c..dc3de74 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -4,4 +4,4 @@ pub mod packet; pub mod render; pub mod router; pub mod server; -pub mod session; +// pub mod session; diff --git a/src/utils/gear.rs b/src/utils/gear.rs index a051839..fb9ab59 100644 --- a/src/utils/gear.rs +++ b/src/utils/gear.rs @@ -35,12 +35,12 @@ impl<'a> AbsoluteNonceSequence<'a> { /// /// Used to abstract Oblivion's handling of transmitted data, wrapping all data type conversions. #[derive(Debug)] -pub struct Socket<'a> { - pub tcp: &'a mut TcpStream, +pub struct Socket { + pub tcp: TcpStream, } -impl<'a> Socket<'a> { - pub fn new(tcp: &'a mut TcpStream) -> Self { +impl Socket { + pub fn new(tcp: TcpStream) -> Self { Self { tcp } }