Skip to content

Commit

Permalink
Implement is_zero method for U64HexOrNumber (alloy-rs#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored and ben186 committed Jul 27, 2024
1 parent ccccc62 commit b628bc1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/serde/src/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ impl U64HexOrNumber {
pub fn to(self) -> u64 {
self.0.to()
}

/// Checks if the wrapped value is zero.
pub fn is_zero(&self) -> bool {
self.0.is_zero()
}
}

impl From<u64> for U64HexOrNumber {
Expand Down

0 comments on commit b628bc1

Please sign in to comment.