Skip to content

Commit 959bd84

Browse files
committed
Remove async-trait dependency
1 parent b1ae92e commit 959bd84

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ readme = "README.md"
1010
keywords = ["tokio", "async", "socks", "proxy"]
1111
categories = ["asynchronous", "authentication", "network-programming"]
1212
include = ["Cargo.toml", "LICENSE-*.md", "src/**/*"]
13-
edition = "2018"
13+
edition = "2021"
1414

1515
[badges]
1616
github-actions = { repository = "https://github.com/ark0f/async-socks5", workflow = "CI" }
1717

1818
[dependencies]
1919
tokio = { version = "1.0", features = ["net", "io-util"] }
2020
thiserror = "1.0.0"
21-
async-trait = "0.1.8"
2221

2322
[dev-dependencies]
2423
tokio = { version = "1.0", features = ["net", "io-util", "rt", "macros"] }

src/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
#![deny(missing_debug_implementations)]
66

7-
use async_trait::async_trait;
87
use std::{
98
fmt::Debug,
109
io::Cursor,
@@ -78,7 +77,6 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
7877
// Utilities
7978
// *****************************************************************************
8079

81-
#[async_trait]
8280
trait ReadExt: AsyncReadExt + Unpin {
8381
async fn read_version(&mut self) -> Result<()> {
8482
let value = self.read_u8().await?;
@@ -240,10 +238,8 @@ trait ReadExt: AsyncReadExt + Unpin {
240238
}
241239
}
242240

243-
#[async_trait]
244241
impl<T: AsyncReadExt + Unpin> ReadExt for T {}
245242

246-
#[async_trait]
247243
trait WriteExt: AsyncWriteExt + Unpin {
248244
async fn write_version(&mut self) -> Result<()> {
249245
self.write_u8(0x05).await?;
@@ -343,7 +339,6 @@ trait WriteExt: AsyncWriteExt + Unpin {
343339
}
344340
}
345341

346-
#[async_trait]
347342
impl<T: AsyncWriteExt + Unpin> WriteExt for T {}
348343

349344
async fn username_password_auth<S>(stream: &mut S, auth: Auth) -> Result<()>
@@ -802,7 +797,6 @@ mod tests {
802797
type TestDatagram = SocksDatagram<TestStream>;
803798
type TestHalves = (Arc<TestDatagram>, Arc<TestDatagram>);
804799

805-
#[async_trait]
806800
trait UdpClient {
807801
async fn send_to<A>(&mut self, buf: &[u8], addr: A) -> Result<usize>
808802
where
@@ -811,7 +805,6 @@ mod tests {
811805
async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, AddrKind)>;
812806
}
813807

814-
#[async_trait]
815808
impl UdpClient for TestDatagram {
816809
async fn send_to<A>(&mut self, buf: &[u8], addr: A) -> Result<usize, Error>
817810
where
@@ -825,7 +818,6 @@ mod tests {
825818
}
826819
}
827820

828-
#[async_trait]
829821
impl UdpClient for TestHalves {
830822
async fn send_to<A>(&mut self, buf: &[u8], addr: A) -> Result<usize, Error>
831823
where

0 commit comments

Comments
 (0)