Skip to content

Commit

Permalink
fix: remove lifetime for socket
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 committed Apr 19, 2024
1 parent 8673a87 commit abc5085
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/models/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down
2 changes: 1 addition & 1 deletion src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pub mod packet;
pub mod render;
pub mod router;
pub mod server;
pub mod session;
// pub mod session;
8 changes: 4 additions & 4 deletions src/utils/gear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand Down

0 comments on commit abc5085

Please sign in to comment.