Skip to content

Commit 54f462c

Browse files
committed
rust edition 2024
1 parent cbc0104 commit 54f462c

File tree

18 files changed

+23
-24
lines changed

18 files changed

+23
-24
lines changed

.github/workflows/auto-merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
token: ${{ secrets.GITHUB_TOKEN }}
19+
- uses: dtolnay/rust-toolchain@stable
1920
- name: Auto approve pull request, then squash and merge
2021
uses: ahmadnassri/action-dependabot-auto-merge@v2
2122
with:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
runs-on: ${{ matrix.host_os }}
4242
steps:
4343
- uses: actions/checkout@v4
44+
- uses: dtolnay/rust-toolchain@stable
4445

4546
- name: Prepare
4647
shell: bash

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
- uses: dtolnay/rust-toolchain@stable
2526
- name: rustfmt
2627
run: cargo fmt --all -- --check
2728
- name: check

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ authors = ["ssrlive <[email protected]>"]
55
description = "Fundamental abstractions and async read / write functions for SOCKS5 protocol and Relatively low-level asynchronized SOCKS5 server implementation based on tokio"
66
categories = ["network-programming", "asynchronous"]
77
keywords = ["socks5", "socks", "proxy", "async", "network"]
8-
edition = "2021"
8+
edition = "2024"
99
readme = "README.md"
1010
license = "GPL-3.0-or-later"
1111
repository = "https://github.com/ssrlive/socks5-impl"
1212

1313
[features]
14-
# default = ["serde", "client", "server", "tokio"]
14+
default = ["serde", "client", "server", "tokio"]
1515
client = ["tokio"]
1616
serde = ["dep:serde"]
1717
server = ["tokio"]

examples/demo-client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use socks5_impl::{client, Result};
1+
use socks5_impl::{Result, client};
22
use tokio::io::{AsyncReadExt, AsyncWriteExt, BufStream};
33
use tokio::net::TcpStream;
44

examples/demo-server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use socks5_impl::protocol::{handshake, Address, AsyncStreamOperation, AuthMethod, Reply, Request, Response};
1+
use socks5_impl::protocol::{Address, AsyncStreamOperation, AuthMethod, Reply, Request, Response, handshake};
22
use std::io;
33
use tokio::{io::AsyncWriteExt, net::TcpListener};
44

examples/dns-query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mod util;
22

33
use hickory_proto::rr::record_type::RecordType;
4-
use socks5_impl::{client, protocol::UserKey, Result};
4+
use socks5_impl::{Result, client, protocol::UserKey};
55
use std::{net::SocketAddr, time::Duration};
66
use tokio::{
77
io::{AsyncReadExt, AsyncWriteExt},

examples/s5-server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use socks5_impl::{
2-
protocol::{Address, Reply, UdpHeader},
3-
server::{auth, connection::associate, AssociatedUdpSocket, ClientConnection, IncomingConnection, Server, UdpAssociate},
42
Error, Result,
3+
protocol::{Address, Reply, UdpHeader},
4+
server::{AssociatedUdpSocket, ClientConnection, IncomingConnection, Server, UdpAssociate, auth, connection::associate},
55
};
66
use std::{
77
net::{SocketAddr, ToSocketAddrs},
8-
sync::{atomic::AtomicBool, Arc},
8+
sync::{Arc, atomic::AtomicBool},
99
};
1010
use tokio::{
1111
io,

examples/udp-client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use socks5_impl::{client::UdpClientImpl, protocol::UserKey, Result};
1+
use socks5_impl::{Result, client::UdpClientImpl, protocol::UserKey};
22
use std::{
33
net::{SocketAddr, ToSocketAddrs},
44
time::Duration,

examples/util/dns.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![allow(dead_code)]
22

33
use hickory_proto::{
4-
op::{header::MessageType, op_code::OpCode, query::Query, Message, ResponseCode},
5-
rr::{record_type::RecordType, Name, RData},
4+
op::{Message, ResponseCode, header::MessageType, op_code::OpCode, query::Query},
5+
rr::{Name, RData, record_type::RecordType},
66
};
77
use std::{net::IpAddr, str::FromStr};
88

0 commit comments

Comments
 (0)