Skip to content

Commit

Permalink
Merge pull request #788 from newpavlov/patch-2
Browse files Browse the repository at this point in the history
Quick and dirty fix for rand_jitter error type
  • Loading branch information
dhardy committed May 2, 2019
2 parents d998742 + 673c6ab commit 0cbbcad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions rand_jitter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.4] - 2019-05-02
- Change error conversion code to partially fix #738

## [0.1.3] - 2019-02-05
- Use libc in `no_std` mode to fix #723

Expand Down
4 changes: 2 additions & 2 deletions rand_jitter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "rand_jitter"
version = "0.1.3"
version = "0.1.4"
authors = ["The Rand Project Developers"]
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-random/rand"
documentation = "https://docs.rs/rand_jitter"
Expand Down
8 changes: 6 additions & 2 deletions rand_jitter/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ impl From<TimerError> for Error {
fn from(err: TimerError) -> Error {
// Timer check is already quite permissive of failures so we don't
// expect false-positive failures, i.e. any error is irrecoverable.
Error::with_cause(ErrorKind::Unavailable,
"timer jitter failed basic quality tests", err)
#[cfg(feature = "std")] {
Error::with_cause(ErrorKind::Unavailable, "timer jitter failed basic quality tests", err)
}
#[cfg(not(feature = "std"))] {
Error::new(ErrorKind::Unavailable, "timer jitter failed basic quality tests")
}
}
}

0 comments on commit 0cbbcad

Please sign in to comment.