make clippy happy #488
Annotations
5 errors and 10 warnings
incorrect implementation of `partial_cmp` on an `Ord` type:
crates/shadowsocks/src/relay/udprelay/aead_2022.rs#L120
error: incorrect implementation of `partial_cmp` on an `Ord` type
--> crates/shadowsocks/src/relay/udprelay/aead_2022.rs:120:1
|
120 | / impl PartialOrd for CipherKey {
121 | | fn partial_cmp(&self, other: &CipherKey) -> Option<Ordering> {
| | __________________________________________________________________-
122 | || let hash1 = {
123 | || let mut hasher = DefaultHasher::new();
124 | || self.hash(&mut hasher);
... ||
133 | || hash1.partial_cmp(&hash2)
134 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
135 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
= note: `#[deny(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default
|
clippy-check (ubuntu-latest)
Clippy had exited with the 101 exit code
|
clippy-check (macos-latest)
The job was canceled because "ubuntu-latest" failed.
|
clippy-check (windows-latest)
The job was canceled because "ubuntu-latest" failed.
|
clippy-check (windows-latest)
The operation was canceled.
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L258
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:258:39
|
258 | pub async fn read_from<R>(stream: &mut R) -> Result<Address, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
= note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L538
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:538:34
|
538 | pub async fn read_from<R>(r: &mut R) -> Result<TcpRequestHeader, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L612
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:612:34
|
612 | pub async fn read_from<R>(r: &mut R) -> Result<TcpResponseHeader, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L679
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:679:34
|
679 | pub async fn read_from<R>(r: &mut R) -> Result<HandshakeRequest, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L743
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:743:34
|
743 | pub async fn read_from<R>(r: &mut R) -> Result<HandshakeResponse, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L807
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:807:34
|
807 | pub async fn read_from<R>(r: &mut R) -> Result<UdpAssociateHeader, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L879
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:879:34
|
879 | pub async fn read_from<R>(r: &mut R) -> Result<PasswdAuthRequest, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/socks5.rs#L956
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/socks5.rs:956:34
|
956 | pub async fn read_from<R>(r: &mut R) -> Result<PasswdAuthResponse, Error>
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/tcprelay/proxy_stream/protocol/v1.rs#L15
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/tcprelay/proxy_stream/protocol/v1.rs:15:58
|
15 | pub async fn read_from<R: AsyncRead + Unpin>(reader: &mut R) -> io::Result<StreamTcpRequestHeader> {
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|
this argument is a mutable reference, but not used mutably:
crates/shadowsocks/src/relay/tcprelay/proxy_stream/protocol/v2.rs#L30
warning: this argument is a mutable reference, but not used mutably
--> crates/shadowsocks/src/relay/tcprelay/proxy_stream/protocol/v2.rs:30:58
|
30 | pub async fn read_from<R: AsyncRead + Unpin>(reader: &mut R) -> io::Result<Aead2022TcpRequestHeader> {
| ^^^^^^ help: consider changing to: `&R`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
|