Skip to content

Commit

Permalink
Merge pull request #387 from nickelc/deps/socket2
Browse files Browse the repository at this point in the history
Replace deprecated `net2` dev dependency with `socket2`
  • Loading branch information
agalakhov authored Nov 17, 2023
2 parents a6cbed7 + 8ca9b23 commit 08cdd76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ version = "0.25"
criterion = "0.5.0"
env_logger = "0.10.0"
input_buffer = "0.5.0"
net2 = "0.2.37"
rand = "0.8.4"
socket2 = "0.5.5"

[[bench]]
name = "buffer"
Expand Down
6 changes: 3 additions & 3 deletions tests/connection_reset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{
time::Duration,
};

use net2::TcpStreamExt;
use socket2::Socket;
use tungstenite::{accept, connect, stream::MaybeTlsStream, Error, Message, WebSocket};
use url::Url;

Expand All @@ -19,7 +19,7 @@ type Sock = WebSocket<MaybeTlsStream<TcpStream>>;
fn do_test<CT, ST>(port: u16, client_task: CT, server_task: ST)
where
CT: FnOnce(Sock) + Send + 'static,
ST: FnOnce(WebSocket<TcpStream>),
ST: FnOnce(WebSocket<Socket>),
{
env_logger::try_init().ok();

Expand All @@ -40,7 +40,7 @@ where
});

let client_handler = server.incoming().next().unwrap();
let client_handler = accept(client_handler.unwrap()).unwrap();
let client_handler = accept(Socket::from(client_handler.unwrap())).unwrap();

server_task(client_handler);

Expand Down

0 comments on commit 08cdd76

Please sign in to comment.