Skip to content

Commit

Permalink
appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Jan 14, 2025
1 parent c540d32 commit 6461b9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl ops::Deref for SudoString {
type Target = str;

fn deref(&self) -> &Self::Target {
let num_bytes = self.inner.as_bytes().len();
let num_bytes = self.inner.len();
&self.inner[..num_bytes - NULL_BYTE_UTF8_LEN]
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/sudoers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ fn in_group(user: &impl UnixUser, group: &impl UnixGroup) -> bool {
fn match_group(group: &impl UnixGroup) -> impl Fn(&Identifier) -> bool + '_ {
move |id| match id {
Identifier::ID(num) => group.as_gid() == GroupId::new(*num),
Identifier::Name(name) => group.try_as_name().map_or(false, |s| name == s),
Identifier::Name(name) => group.try_as_name().is_some_and(|s| name == s),
}
}

Expand Down

0 comments on commit 6461b9b

Please sign in to comment.