Use alloc for no_std builds
[rust-lightning] / lightning / src / ln / peer_handler.rs
index f9e79429913dac7815ada3b90a6f7c58a7519bb5..33c4050b374dd21fa4eeb3486bb179ae91c85f4e 100644 (file)
@@ -30,11 +30,14 @@ use util::events::{MessageSendEvent, MessageSendEventsProvider};
 use util::logger::Logger;
 use routing::network_graph::NetGraphMsgHandler;
 
-use std::collections::{HashMap,hash_map,HashSet,LinkedList};
+use prelude::*;
+use alloc::collections::LinkedList;
+use std::collections::{HashMap,hash_map,HashSet};
 use std::sync::{Arc, Mutex};
-use std::sync::atomic::{AtomicUsize, Ordering};
-use std::{cmp, error, hash, fmt, mem};
-use std::ops::Deref;
+use core::sync::atomic::{AtomicUsize, Ordering};
+use core::{cmp, hash, fmt, mem};
+use core::ops::Deref;
+use std::error;
 
 use bitcoin::hashes::sha256::Hash as Sha256;
 use bitcoin::hashes::sha256::HashEngine as Sha256Engine;
@@ -1420,9 +1423,9 @@ mod tests {
        use bitcoin::secp256k1::Secp256k1;
        use bitcoin::secp256k1::key::{SecretKey, PublicKey};
 
-       use std;
+       use prelude::*;
        use std::sync::{Arc, Mutex};
-       use std::sync::atomic::Ordering;
+       use core::sync::atomic::Ordering;
 
        #[derive(Clone)]
        struct FileDescriptor {
@@ -1435,8 +1438,8 @@ mod tests {
                }
        }
        impl Eq for FileDescriptor { }
-       impl std::hash::Hash for FileDescriptor {
-               fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) {
+       impl core::hash::Hash for FileDescriptor {
+               fn hash<H: core::hash::Hasher>(&self, hasher: &mut H) {
                        self.fd.hash(hasher)
                }
        }