Do more sensible things when `std` feature is enabled/disabled.

This commit is contained in:
Sean Bowe 2018-09-01 14:17:20 -06:00
parent c8128b692d
commit 39eda03c74
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 4 additions and 7 deletions

View File

@ -1,11 +1,8 @@
// This crate is `no_std` unless test mode is enabled.
#![cfg_attr(not(test), no_std)]
#![no_std]
// Import `core` explicitly (it is imported implicitly
// when `no_std` is enabled, but this does not occur
// during testing)
#[cfg(test)]
extern crate core;
#[cfg(feature = "std")]
#[macro_use]
extern crate std;
extern crate byteorder;
extern crate subtle;