Skip to content

Commit

Permalink
Refactor Nonce implementation to include conversion from usize
Browse files Browse the repository at this point in the history
  • Loading branch information
b3hr4d committed Sep 19, 2024
1 parent 87db515 commit 6627f79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/nonce/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ impl TryFrom<&[u8]> for Nonce {
}
}

impl From<usize> for Nonce {
fn from(value: usize) -> Self {
Self(value as u64)
}
}

impl From<u64> for Nonce {
fn from(value: u64) -> Self {
Self(value)
Expand Down

0 comments on commit 6627f79

Please sign in to comment.