mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
chore: more clippy checked suggestions
This commit is contained in:
@@ -281,7 +281,7 @@ impl PacketFilter {
|
||||
|
||||
let states_count = states.ps_len as usize / mem::size_of::<pfsync_state>();
|
||||
for i in 0..states_count {
|
||||
let state = &*(states.ps_u.psu_states.offset(i as isize));
|
||||
let state = &*(states.ps_u.psu_states.add(i));
|
||||
|
||||
if state.proto == libc::IPPROTO_UDP as u8 {
|
||||
cfg_if! {
|
||||
|
||||
@@ -13,12 +13,12 @@ cfg_if! {
|
||||
target_os = "ios"))] {
|
||||
#[path = "pfvar_bindgen_macos.rs"]
|
||||
#[allow(dead_code, non_upper_case_globals, non_snake_case, non_camel_case_types)]
|
||||
#[allow(clippy::useless_transmute)]
|
||||
#[allow(clippy::useless_transmute, clippy::too_many_arguments, clippy::unnecessary_cast)]
|
||||
mod pfvar;
|
||||
} else if #[cfg(target_os = "freebsd")] {
|
||||
#[path = "pfvar_bindgen_freebsd.rs"]
|
||||
#[allow(dead_code, non_upper_case_globals, non_snake_case, non_camel_case_types)]
|
||||
#[allow(clippy::useless_transmute)]
|
||||
#[allow(clippy::useless_transmute, clippy::too_many_arguments, clippy::unnecessary_cast)]
|
||||
mod pfvar;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ pub fn run_as_user(uname: &str) -> std::io::Result<()> {
|
||||
return Err(err);
|
||||
}
|
||||
|
||||
if libc::initgroups(pwd.pw_name, pwd.pw_gid.try_into().unwrap()) != 0 {
|
||||
if libc::initgroups(pwd.pw_name, pwd.pw_gid as _) != 0 {
|
||||
let err = Error::last_os_error();
|
||||
error!(
|
||||
"could not change supplementary groups to user {:?}'s gid: {}, uid: {}, error: {}",
|
||||
|
||||
Reference in New Issue
Block a user