Skip to content

Commit

Permalink
chore: more clippy checked suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Feb 1, 2024
1 parent ab6c339 commit a82911c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down
4 changes: 2 additions & 2 deletions crates/shadowsocks-service/src/local/redir/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}",
Expand Down

0 comments on commit a82911c

Please sign in to comment.