1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #5842 from cakebaker/uucore_fix_clippy_warning

uucore: fix clippy warning from if_not_else lint
This commit is contained in:
Sylvestre Ledru 2024-01-15 10:40:23 +01:00 committed by GitHub
commit e340d8177e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,10 +146,10 @@ impl Formatter for UnsignedInt {
// We also need to take into account that 0 should not be 00 // 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 // Since this is an unsigned int, we do not need to take the minus
// sign into account. // sign into account.
if x != 0 { if x == 0 {
format!("0{x:o}")
} else {
format!("{x:o}") format!("{x:o}")
} else {
format!("0{x:o}")
} }
} }
UnsignedIntVariant::Hexadecimal(Case::Lowercase, Prefix::No) => { UnsignedIntVariant::Hexadecimal(Case::Lowercase, Prefix::No) => {