Skip to content

Commit

Permalink
appease clippy 1.81
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Sep 6, 2024
1 parent 6c1fbd7 commit 8b8836b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sudo/env/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ fn is_printable(input: &[u8]) -> bool {
/// It contains white space or non-printable characters.
/// It is longer than the value of PATH_MAX.
fn is_safe_tz(value: &[u8]) -> bool {
let check_value = if value.starts_with(&[b':']) {
let check_value = if value.starts_with(b":") {
&value[1..]
} else {
value
};

if check_value.starts_with(&[b'/']) {
if check_value.starts_with(b"/") {
// clippy 1.79 wants to us to optimise this check away; but we don't know what this will always
// be possible; and the compiler is clever enough to do that for us anyway if it can be.
#[allow(clippy::const_is_empty)]
Expand Down

0 comments on commit 8b8836b

Please sign in to comment.