Skip to content

Commit

Permalink
Imply using alloc crate when std is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Jan 21, 2020
1 parent 7852d2f commit bac77ed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Expand Up @@ -342,7 +342,7 @@ extern crate ryu;

////////////////////////////////////////////////////////////////////////////////

#[cfg(feature = "alloc")]
#[cfg(not(feature = "std"))]
extern crate alloc;

/// A facade around all the types we need from the `std`, `core`, and `alloc`
Expand Down Expand Up @@ -370,27 +370,27 @@ mod lib {
pub use self::core::marker::{self, PhantomData};
pub use self::core::result::{self, Result};

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
pub use alloc::borrow::{Cow, ToOwned};
#[cfg(feature = "std")]
pub use std::borrow::{Cow, ToOwned};

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
pub use alloc::string::{String, ToString};
#[cfg(feature = "std")]
pub use std::string::{String, ToString};

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
pub use alloc::vec::{self, Vec};
#[cfg(feature = "std")]
pub use std::vec::{self, Vec};

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
pub use alloc::boxed::Box;
#[cfg(feature = "std")]
pub use std::boxed::Box;

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
pub use alloc::collections::{btree_map, BTreeMap};
#[cfg(feature = "std")]
pub use std::collections::{btree_map, BTreeMap};
Expand Down

0 comments on commit bac77ed

Please sign in to comment.