During some lint tests on OpenBSD (Rust 1.72.1) with rust-clippy, I found a warning/error for clippy::if_not_else in uucore/src/lib/features/format/num_format.rs (line 149, function Formatter::fmt).
// The prefix that rust uses is `0o`, but GNU uses `0`.
// We also need to take into account that 0 should not be 00
// Since this is an unsigned int, we do not need to take the minus
// sign into account.
if x != 0 {
format!("0{x:o}")
} else {
format!("{x:o}")
}
I don't understand why this warning is not detected by CI job for Lint (clippy run with -D warning flag): clippy::if_not_else is included in warnings by default.
This warning could be removed with #[allow(clippy::if_not_else)] or maybe by modifying the if not/else logic.