X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Frouter.rs;h=0edeef0c3cb3d9629ddcfd4445dbf2f1fccf3af4;hb=da7a851d4785891190b70ff03c21fa6340a7ec5a;hp=9f4b8ac3589a27ef7c713751eb1d98ad18596978;hpb=4d1c1a32f20dcce2553ba7ec467e349fc37493c8;p=rust-lightning diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 9f4b8ac3..0edeef0c 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -24,7 +24,6 @@ use util::logger::Logger; use prelude::*; use alloc::collections::BinaryHeap; use core::cmp; -use std::collections::HashMap; use core::ops::Deref; /// A hop in a route @@ -3843,6 +3842,7 @@ mod tests { } } + #[cfg(not(feature = "no_std"))] pub(super) fn random_init_seed() -> u64 { // Because the default HashMap in std pulls OS randomness, we can use it as a (bad) RNG. use core::hash::{BuildHasher, Hasher}; @@ -3850,9 +3850,11 @@ mod tests { println!("Using seed of {}", seed); seed } + #[cfg(not(feature = "no_std"))] use util::ser::Readable; #[test] + #[cfg(not(feature = "no_std"))] fn generate_routes() { let mut d = match super::test_utils::get_route_file() { Ok(f) => f, @@ -3880,6 +3882,7 @@ mod tests { } #[test] + #[cfg(not(feature = "no_std"))] fn generate_routes_mpp() { let mut d = match super::test_utils::get_route_file() { Ok(f) => f, @@ -3907,7 +3910,7 @@ mod tests { } } -#[cfg(test)] +#[cfg(all(test, not(feature = "no_std")))] pub(crate) mod test_utils { use std::fs::File; /// Tries to open a network graph file, or panics with a URL to fetch it. @@ -3934,7 +3937,7 @@ pub(crate) mod test_utils { } } -#[cfg(all(test, feature = "unstable"))] +#[cfg(all(test, feature = "unstable", not(feature = "no_std")))] mod benches { use super::*; use util::logger::{Logger, Record};