Skip to content

Commit

Permalink
use into instead of try_into
Browse files Browse the repository at this point in the history
  • Loading branch information
pscott committed Mar 4, 2024
1 parent 6243fa2 commit 6d95478
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lottery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,9 @@ async fn get_randao_reveal(timestamp: u64) -> Result<[u8; 32], ServerError> {
// Step 2: Hash the byte array
let mut hasher = Sha256::new();
hasher.update(&bytes);
let hash_result = hasher.finalize();

// Step 3: Convert the hash bytes to a fixed-size array for the seed
let seed = hash_result
.try_into()
.expect("Hash output size is incorrect for seed");
let seed = hasher.finalize().into();

Ok(seed)
}
Expand Down

0 comments on commit 6d95478

Please sign in to comment.