X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Flib.rs;h=14445710655b277f32eaeb1033a475b3b3c53c9e;hb=288b93b3dada1f8b6f4a4359f0977d2a0c7c61fe;hp=2d764c8b71b1355200ca062087fcb22044b5c24b;hpb=fba204b02ee4faece07a2ddf152f34507773ad4d;p=rust-lightning diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index 2d764c8b..14445710 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -28,10 +28,12 @@ #![allow(bare_trait_objects)] #![allow(ellipsis_inclusive_range_patterns)] -#![cfg_attr(all(test, feature = "unstable"), feature(test))] -#[cfg(all(test, feature = "unstable"))] extern crate test; +#![cfg_attr(all(any(test, feature = "_test_utils"), feature = "unstable"), feature(test))] +#[cfg(all(any(test, feature = "_test_utils"), feature = "unstable"))] extern crate test; +extern crate alloc; extern crate bitcoin; +extern crate core; #[cfg(any(test, feature = "_test_utils"))] extern crate hex; #[cfg(any(test, feature = "fuzztarget", feature = "_test_utils"))] extern crate regex; @@ -40,3 +42,22 @@ pub mod util; pub mod chain; pub mod ln; pub mod routing; + +mod prelude { + #[cfg(feature = "hashbrown")] + extern crate hashbrown; + + pub use alloc::{vec, vec::Vec, string::String, collections::VecDeque}; + #[cfg(not(feature = "hashbrown"))] + pub use std::collections::{HashMap, HashSet, hash_map}; + #[cfg(feature = "hashbrown")] + pub use self::hashbrown::{HashMap, HashSet, hash_map}; +} + +#[cfg(feature = "std")] +mod sync { + pub use ::std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard}; +} + +#[cfg(not(feature = "std"))] +mod sync;