Skip to content

Commit e340d81

Browse files
authored
Merge pull request #5842 from cakebaker/uucore_fix_clippy_warning
uucore: fix clippy warning from if_not_else lint
2 parents 076b905 + e91540f commit e340d81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/uucore/src/lib/features/format/num_format.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ impl Formatter for UnsignedInt {
146146
// We also need to take into account that 0 should not be 00
147147
// Since this is an unsigned int, we do not need to take the minus
148148
// sign into account.
149-
if x != 0 {
150-
format!("0{x:o}")
151-
} else {
149+
if x == 0 {
152150
format!("{x:o}")
151+
} else {
152+
format!("0{x:o}")
153153
}
154154
}
155155
UnsignedIntVariant::Hexadecimal(Case::Lowercase, Prefix::No) => {

0 commit comments

Comments
 (0)