Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick and dirty fix for rand_jitter error type #788

Merged
merged 2 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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")
}
}
}