File tree Expand file tree Collapse file tree 4 files changed +36
-18
lines changed Expand file tree Collapse file tree 4 files changed +36
-18
lines changed Original file line number Diff line number Diff line change 46
46
- run : cargo check --verbose --no-default-features --features=proxy,use-openssl
47
47
- run : cargo check --verbose --no-default-features --features=proxy,use-rustls
48
48
- run : cargo check --verbose --no-default-features --features=proxy,use-rustls-ring
49
+
50
+ fmt :
51
+ name : Rust fmt
52
+ runs-on : ubuntu-latest
53
+ steps :
54
+ - name : Checkout
55
+ uses : actions/checkout@v2
56
+ - name : Install Rust toolchain
57
+ uses : actions-rs/toolchain@v1
58
+ with :
59
+ toolchain : stable
60
+ override : true
61
+ profile : minimal
62
+ components : rustfmt
63
+ - name : Check fmt
64
+ run : cargo fmt --all -- --config format_code_in_doc_comments=true --check
65
+
66
+ clippy_check :
67
+ runs-on : ubuntu-latest
68
+ steps :
69
+ - uses : actions/checkout@v1
70
+ - uses : actions-rs/toolchain@v1
71
+ with :
72
+ toolchain : 1.78.0
73
+ components : clippy
74
+ override : true
75
+ - name : Rust Cache
76
+ uses : Swatinem/rust-cache@v2.2.1
77
+ - uses : actions-rs/clippy-check@v1
78
+ with :
79
+ token : ${{ secrets.GITHUB_TOKEN }}
80
+ args : --all-features --all-targets -- -D warnings
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ impl Client {
148
148
/// If no prefix is specified, then `tcp://` is assumed.
149
149
///
150
150
/// See [Client::from_config] for more configuration options
151
- ///
152
151
pub fn new ( url : & str ) -> Result < Self , Error > {
153
152
Self :: from_config ( url, Config :: default ( ) )
154
153
}
Original file line number Diff line number Diff line change @@ -117,10 +117,7 @@ impl Socks4Stream {
117
117
socket. write_all ( & packet) ?;
118
118
let proxy_addr = read_response ( & mut socket) ?;
119
119
120
- Ok ( Socks4Stream {
121
- socket,
122
- proxy_addr,
123
- } )
120
+ Ok ( Socks4Stream { socket, proxy_addr } )
124
121
}
125
122
126
123
/// Returns the proxy-side address of the connection between the proxy and
Original file line number Diff line number Diff line change @@ -253,10 +253,7 @@ impl Socks5Stream {
253
253
254
254
let proxy_addr = read_response ( & mut socket) ?;
255
255
256
- Ok ( Socks5Stream {
257
- socket,
258
- proxy_addr,
259
- } )
256
+ Ok ( Socks5Stream { socket, proxy_addr } )
260
257
}
261
258
262
259
fn password_authentication (
@@ -470,10 +467,7 @@ impl Socks5Datagram {
470
467
let socket = UdpSocket :: bind ( addr) ?;
471
468
socket. connect ( & stream. proxy_addr ) ?;
472
469
473
- Ok ( Socks5Datagram {
474
- socket,
475
- stream,
476
- } )
470
+ Ok ( Socks5Datagram { socket, stream } )
477
471
}
478
472
479
473
/// Like `UdpSocket::send_to`.
@@ -522,11 +516,7 @@ impl Socks5Datagram {
522
516
let addr = read_addr ( & mut header) ?;
523
517
524
518
unsafe {
525
- ptr:: copy (
526
- buf. as_ptr ( ) ,
527
- buf. as_mut_ptr ( ) . add ( header. len ( ) ) ,
528
- overflow,
529
- ) ;
519
+ ptr:: copy ( buf. as_ptr ( ) , buf. as_mut_ptr ( ) . add ( header. len ( ) ) , overflow) ;
530
520
}
531
521
buf[ ..header. len ( ) ] . copy_from_slice ( header) ;
532
522
You can’t perform that action at this time.
0 commit comments