File tree Expand file tree Collapse file tree 3 files changed +36
-17
lines changed
Expand file tree Collapse file tree 3 files changed +36
-17
lines changed Original file line number Diff line number Diff line change 4646 - run : cargo check --verbose --no-default-features --features=proxy,use-openssl
4747 - run : cargo check --verbose --no-default-features --features=proxy,use-rustls
4848 - 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 @@ -117,10 +117,7 @@ impl Socks4Stream {
117117 socket. write_all ( & packet) ?;
118118 let proxy_addr = read_response ( & mut socket) ?;
119119
120- Ok ( Socks4Stream {
121- socket,
122- proxy_addr,
123- } )
120+ Ok ( Socks4Stream { socket, proxy_addr } )
124121 }
125122
126123 /// 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 {
253253
254254 let proxy_addr = read_response ( & mut socket) ?;
255255
256- Ok ( Socks5Stream {
257- socket,
258- proxy_addr,
259- } )
256+ Ok ( Socks5Stream { socket, proxy_addr } )
260257 }
261258
262259 fn password_authentication (
@@ -470,10 +467,7 @@ impl Socks5Datagram {
470467 let socket = UdpSocket :: bind ( addr) ?;
471468 socket. connect ( & stream. proxy_addr ) ?;
472469
473- Ok ( Socks5Datagram {
474- socket,
475- stream,
476- } )
470+ Ok ( Socks5Datagram { socket, stream } )
477471 }
478472
479473 /// Like `UdpSocket::send_to`.
@@ -522,11 +516,7 @@ impl Socks5Datagram {
522516 let addr = read_addr ( & mut header) ?;
523517
524518 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) ;
530520 }
531521 buf[ ..header. len ( ) ] . copy_from_slice ( header) ;
532522
You can’t perform that action at this time.
0 commit comments