Skip to content

Fix load balancer to add per server fwmark for outbound traffic #1055

Fix load balancer to add per server fwmark for outbound traffic

Fix load balancer to add per server fwmark for outbound traffic #1055

Triggered via push April 14, 2024 14:03
Status Success
Total duration 3m 21s
Artifacts

clippy-check.yml

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

Annotations

16 warnings
importing legacy numeric constants: crates/shadowsocks/src/relay/tcprelay/aead.rs#L40
warning: importing legacy numeric constants --> crates/shadowsocks/src/relay/tcprelay/aead.rs:40:5 | 40 | u16, | ^^^ | = help: remove this import = note: then `u16::<CONST>` will resolve to the respective associated constant = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
importing legacy numeric constants: crates/shadowsocks/src/relay/tcprelay/aead_2022.rs#L54
warning: importing legacy numeric constants --> crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:54:5 | 54 | u16, | ^^^ | = help: remove this import = note: then `u16::<CONST>` will resolve to the respective associated constant = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
using `clone` on type `Option<u32>` which implements the `Copy` trait: crates/shadowsocks-service/src/config.rs#L2825
warning: using `clone` on type `Option<u32>` which implements the `Copy` trait --> crates/shadowsocks-service/src/config.rs:2825:42 | 2825 | outbound_fwmark: inst.outbound_fwmark.clone(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `inst.outbound_fwmark` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/config.rs#L2929
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/config.rs:2929:9 | 2929 | jconf.outbound_bind_interface = self.outbound_bind_interface.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `jconf.outbound_bind_interface.clone_from(&self.outbound_bind_interface)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `#[warn(clippy::assigning_clones)]` on by default
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/server/udprelay.rs#L651
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/server/udprelay.rs:651:13 | 651 | session_context.client_user = control.user.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `session_context.client_user.clone_from(&control.user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/server/udprelay.rs#L825
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/server/udprelay.rs:825:17 | 825 | control.user = client_session.client_user.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `control.user.clone_from(&client_session.client_user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
importing legacy numeric constants: crates/shadowsocks/src/relay/tcprelay/aead.rs#L40
warning: importing legacy numeric constants --> crates/shadowsocks/src/relay/tcprelay/aead.rs:40:5 | 40 | u16, | ^^^ | = help: remove this import = note: then `u16::<CONST>` will resolve to the respective associated constant = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
importing legacy numeric constants: crates/shadowsocks/src/relay/tcprelay/aead_2022.rs#L54
warning: importing legacy numeric constants --> crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:54:5 | 54 | u16, | ^^^ | = help: remove this import = note: then `u16::<CONST>` will resolve to the respective associated constant = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
variable does not need to be mutable: crates/shadowsocks-service/src/local/loadbalancing/server_data.rs#L87
warning: variable does not need to be mutable --> crates/shadowsocks-service/src/local/loadbalancing/server_data.rs:87:13 | 87 | let mut connect_opts = context.connect_opts_ref().clone(); | ----^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/config.rs#L1514
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/config.rs:1514:25 | 1514 | local_config.launchd_tcp_socket_name = config.launchd_tcp_socket_name.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `local_config.launchd_tcp_socket_name.clone_from(&config.launchd_tcp_socket_name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `#[warn(clippy::assigning_clones)]` on by default
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/config.rs#L1515
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/config.rs:1515:25 | 1515 | local_config.launchd_udp_socket_name = config.launchd_udp_socket_name.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `local_config.launchd_udp_socket_name.clone_from(&config.launchd_udp_socket_name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/config.rs#L2563
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/config.rs:2563:21 | 2563 | jconf.launchd_tcp_socket_name = local.launchd_tcp_socket_name.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `jconf.launchd_tcp_socket_name.clone_from(&local.launchd_tcp_socket_name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/config.rs#L2564
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/config.rs:2564:21 | 2564 | jconf.launchd_udp_socket_name = local.launchd_udp_socket_name.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `jconf.launchd_udp_socket_name.clone_from(&local.launchd_udp_socket_name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/config.rs#L2929
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/config.rs:2929:9 | 2929 | jconf.outbound_bind_interface = self.outbound_bind_interface.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `jconf.outbound_bind_interface.clone_from(&self.outbound_bind_interface)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/server/udprelay.rs#L651
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/server/udprelay.rs:651:13 | 651 | session_context.client_user = control.user.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `session_context.client_user.clone_from(&control.user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
assigning the result of `Clone::clone()` may be inefficient: crates/shadowsocks-service/src/server/udprelay.rs#L825
warning: assigning the result of `Clone::clone()` may be inefficient --> crates/shadowsocks-service/src/server/udprelay.rs:825:17 | 825 | control.user = client_session.client_user.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `control.user.clone_from(&client_session.client_user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones