Skip to content

Commit 8e8f542

Browse files
committed
Trivial cleanup on loop condition
Signed-off-by: Nathaniel McCallum <[email protected]>
1 parent 7cc8ef6 commit 8e8f542

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ciborium/src/value/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ impl From<u128> for Value {
500500
}
501501

502502
let mut bytes = &value.to_be_bytes()[..];
503-
while !bytes.is_empty() && bytes[0] == 0 {
503+
while let Some(0) = bytes.get(0) {
504504
bytes = &bytes[1..];
505505
}
506506

@@ -521,7 +521,7 @@ impl From<i128> for Value {
521521
};
522522

523523
let mut bytes = &raw.to_be_bytes()[..];
524-
while !bytes.is_empty() && bytes[0] == 0 {
524+
while let Some(0) = bytes.get(0) {
525525
bytes = &bytes[1..];
526526
}
527527

0 commit comments

Comments
 (0)