Skip to content

Commit

Permalink
Fix trivial no_std-breaking issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Dec 27, 2018
1 parent abe7b2d commit 7ad3bb7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{c, error};
#[repr(transparent)]
pub struct Result(c::int);

impl From<Result> for ::std::result::Result<(), error::Unspecified> {
impl From<Result> for core::result::Result<(), error::Unspecified> {
fn from(ret: Result) -> Self {
match ret.0 {
1 => Ok(()),
Expand Down
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ impl std::error::Error for KeyRejected {
fn description(&self) -> &str { self.description_() }
}

#[cfg(feature = "use_heap")]
impl std::fmt::Display for KeyRejected {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.write_str(self.description_())
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ mod rsa;

pub mod signature;

#[cfg(any(test, feature = "use_heap"))]
pub mod test;

mod sealed {
Expand Down
6 changes: 5 additions & 1 deletion src/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ impl SecureRandom for SystemRandom {

impl sealed::Sealed for SystemRandom {}

#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "ios", windows)))]
#[cfg(all(
feature = "use_heap",
not(any(target_os = "linux", target_os = "macos", target_os = "ios", windows))
))]
use self::urandom::fill as fill_impl;

#[cfg(any(
Expand Down Expand Up @@ -182,6 +185,7 @@ mod sysrand {

// Keep the `cfg` conditions in sync with the conditions in lib.rs.
#[cfg(all(
feature = "use_heap",
any(target_os = "redox", unix),
not(any(target_os = "macos", target_os = "ios")),
not(all(target_os = "linux", not(feature = "dev_urandom_fallback")))
Expand Down

0 comments on commit 7ad3bb7

Please sign in to comment.