Skip to content

Commit

Permalink
Fix clippy warning for wasm32-unknown-unknown target
Browse files Browse the repository at this point in the history
latest function was recursing
DrandError did not need to be added without time feature
  • Loading branch information
Thibault committed Mar 1, 2024
1 parent 5119a6c commit 2115fe4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drand_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- Fix clippy warning for wasm32-unknown-unknown target

## [0.0.15] - 2024-02-29

### Added
Expand Down
4 changes: 3 additions & 1 deletion drand_core/src/beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use time::{

#[cfg(feature = "time")]
use crate::chain::ChainTimeInfo;
use crate::{chain::ChainInfo, DrandError, Result};
#[cfg(feature = "time")]
use crate::DrandError;
use crate::{chain::ChainInfo, Result};

#[derive(Error, Debug)]
pub enum BeaconError {
Expand Down
5 changes: 5 additions & 0 deletions drand_core/src/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ impl HttpClient {
}
}

#[cfg(not(feature = "time"))]
pub fn latest(&self) -> Result<RandomnessBeacon> {
self.get_with_string("latest".to_owned())
}

pub fn get(&self, round_number: u64) -> Result<RandomnessBeacon> {
self.get_with_string(round_number.to_string())
}
Expand Down

0 comments on commit 2115fe4

Please sign in to comment.