Skip to content

fix(shadowsocks): IP_UNICAST_IF requires index to be network endianess #522

fix(shadowsocks): IP_UNICAST_IF requires index to be network endianess

fix(shadowsocks): IP_UNICAST_IF requires index to be network endianess #522

Triggered via push August 12, 2023 14:18
Status Success
Total duration 3m 44s
Artifacts

clippy-check.yml

on: push
Matrix: clippy-check
Fit to window
Zoom out
Zoom in

Annotations

15 warnings
this argument is a mutable reference, but not used mutably: crates/shadowsocks/src/net/sys/unix/uds.rs#L71
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/sys/unix/uds.rs:71:47 | 71 | pub async fn recv_with_fd(&mut self, buf: &mut [u8], fds: &mut [RawFd]) -> io::Result<(usize, usize)> { | ^^^^^^^^^ help: consider changing to: `&[u8]` | = 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/net/sys/unix/uds.rs#L71
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/sys/unix/uds.rs:71:63 | 71 | pub async fn recv_with_fd(&mut self, buf: &mut [u8], fds: &mut [RawFd]) -> io::Result<(usize, usize)> { | ^^^^^^^^^^^^ help: consider changing to: `&[RawFd]` | = 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/net/udp.rs#L191
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/udp.rs:191:42 | 191 | pub async fn batch_send(&self, msgs: &mut [BatchSendMessage<'_>]) -> io::Result<usize> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&[BatchSendMessage<'_>]` | = warning: changing this function will impact semver compatibility = note: this is cfg-gated and may require further changes = 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/net/udp.rs#L229
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/udp.rs:229:42 | 229 | pub async fn batch_recv(&self, msgs: &mut [BatchRecvMessage<'_>]) -> io::Result<usize> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&[BatchRecvMessage<'_>]` | = warning: changing this function will impact semver compatibility = note: this is cfg-gated and may require further changes = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
unnecessary hashes around raw string literal: crates/shadowsocks-service/src/acl/mod.rs#L195
warning: unnecessary hashes around raw string literal --> crates/shadowsocks-service/src/acl/mod.rs:195:17 | 195 | r#"^(?:(?:\((?:\?:)?\^\|\\\.\)|(?:\^\.(?:\+|\*))?\\\.)((?:[\w-]+(?:\\\.)?)+)|\^((?:[\w-]+(?:\\\.)?)+))\$?$"#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `r"^(?:(?:\((?:\?:)?\^\|\\\.\)|(?:\^\.(?:\+|\*))?\\\.)((?:[\w-]+(?:\\\.)?)+)|\^((?:[\w-]+(?:\\\.)?)+))\$?$"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes = note: `#[warn(clippy::needless_raw_string_hashes)]` on by default
this argument is a mutable reference, but not used mutably: crates/shadowsocks-service/src/local/dns/upstream.rs#L161
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks-service/src/local/dns/upstream.rs:161:62 | 161 | fn check_peekable<F: std::os::unix::io::AsRawFd>(fd: &mut F) -> bool { | ^^^^^^ help: consider changing to: `&F` | = note: this is cfg-gated and may require further changes = 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 OR pattern can be rewritten using a range: src/logging/mod.rs#L58
warning: this OR pattern can be rewritten using a range --> src/logging/mod.rs:58:9 | 58 | 0 | 1 | 2 | 3 => logging_builder | ^^^^^^^^^^^^^ help: try: `0..=3` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns = note: `#[warn(clippy::manual_range_patterns)]` on by default
useless conversion to the same type: `u32`: src/sys.rs#L124
warning: useless conversion to the same type: `u32` --> src/sys.rs:124:42 | 124 | if libc::initgroups(pwd.pw_name, pwd.pw_gid.try_into().unwrap()) != 0 { | ^^^^^^^^^^^^^^^^^^^^^ | = help: consider removing `.try_into()` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default
this argument is a mutable reference, but not used mutably: crates/shadowsocks/src/net/sys/unix/uds.rs#L71
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/sys/unix/uds.rs:71:47 | 71 | pub async fn recv_with_fd(&mut self, buf: &mut [u8], fds: &mut [RawFd]) -> io::Result<(usize, usize)> { | ^^^^^^^^^ help: consider changing to: `&[u8]` | = 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/net/sys/unix/uds.rs#L71
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/sys/unix/uds.rs:71:63 | 71 | pub async fn recv_with_fd(&mut self, buf: &mut [u8], fds: &mut [RawFd]) -> io::Result<(usize, usize)> { | ^^^^^^^^^^^^ help: consider changing to: `&[RawFd]` | = 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/net/udp.rs#L191
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/udp.rs:191:42 | 191 | pub async fn batch_send(&self, msgs: &mut [BatchSendMessage<'_>]) -> io::Result<usize> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&[BatchSendMessage<'_>]` | = warning: changing this function will impact semver compatibility = note: this is cfg-gated and may require further changes = 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/net/udp.rs#L229
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks/src/net/udp.rs:229:42 | 229 | pub async fn batch_recv(&self, msgs: &mut [BatchRecvMessage<'_>]) -> io::Result<usize> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&[BatchRecvMessage<'_>]` | = warning: changing this function will impact semver compatibility = note: this is cfg-gated and may require further changes = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
unnecessary hashes around raw string literal: crates/shadowsocks-service/src/acl/mod.rs#L195
warning: unnecessary hashes around raw string literal --> crates/shadowsocks-service/src/acl/mod.rs:195:17 | 195 | r#"^(?:(?:\((?:\?:)?\^\|\\\.\)|(?:\^\.(?:\+|\*))?\\\.)((?:[\w-]+(?:\\\.)?)+)|\^((?:[\w-]+(?:\\\.)?)+))\$?$"#, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `r"^(?:(?:\((?:\?:)?\^\|\\\.\)|(?:\^\.(?:\+|\*))?\\\.)((?:[\w-]+(?:\\\.)?)+)|\^((?:[\w-]+(?:\\\.)?)+))\$?$"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes = note: `#[warn(clippy::needless_raw_string_hashes)]` on by default
this argument is a mutable reference, but not used mutably: crates/shadowsocks-service/src/local/dns/upstream.rs#L161
warning: this argument is a mutable reference, but not used mutably --> crates/shadowsocks-service/src/local/dns/upstream.rs:161:62 | 161 | fn check_peekable<F: std::os::unix::io::AsRawFd>(fd: &mut F) -> bool { | ^^^^^^ help: consider changing to: `&F` | = note: this is cfg-gated and may require further changes = 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 OR pattern can be rewritten using a range: src/logging/mod.rs#L58
warning: this OR pattern can be rewritten using a range --> src/logging/mod.rs:58:9 | 58 | 0 | 1 | 2 | 3 => logging_builder | ^^^^^^^^^^^^^ help: try: `0..=3` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns = note: `#[warn(clippy::manual_range_patterns)]` on by default