Skip to content

Commit

Permalink
Fix CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
kurotych committed Feb 12, 2025
1 parent 1af76ea commit 2b3e3fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions beacon/src/entropy.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{Error, Result};
use base64::{engine::general_purpose::STANDARD, Engine};
use helium_proto::EntropyReportV1;
use rand::{rngs::OsRng, RngCore};
use rand::{rngs::OsRng, TryRngCore};
use serde::{Deserialize, Serialize};
use sha2::Digest;
use std::time::{SystemTime, UNIX_EPOCH};
Expand All @@ -22,7 +22,7 @@ impl Entropy {
/// of local entropy is always 0.
pub fn local() -> Result<Self> {
let mut local_entropy = vec![0u8; LOCAL_ENTROPY_SIZE];
OsRng.fill_bytes(&mut local_entropy);
OsRng.try_fill_bytes(&mut local_entropy)?;
Ok(Self {
version: 0,
timestamp: 0,
Expand Down
3 changes: 3 additions & 0 deletions beacon/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use rand_chacha::rand_core::OsError;
use thiserror::Error;

pub type Result<T = ()> = std::result::Result<T, Error>;
Expand All @@ -24,6 +25,8 @@ pub enum Error {
InvalidVersion,
#[error("no valid datarate found")]
NoDataRate,
#[error("Operation system error")]
OsError(#[from] OsError),
}

impl Error {
Expand Down
2 changes: 1 addition & 1 deletion beacon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn rand_payload<R>(rng: &mut R, size: usize) -> Vec<u8>
where
R: Rng + ?Sized,
{
rng.sample_iter(rand::distributions::Standard)
rng.sample_iter(rand::distr::StandardUniform)
.take(size)
.collect::<Vec<u8>>()
}
Expand Down

0 comments on commit 2b3e3fd

Please sign in to comment.