Fix compilation warnings with --features=no-std
[rust-lightning] / lightning / src / util / test_utils.rs
index 9cd2f9ec13e8bd49de15be2fc0f283fe34660eee..2ec679232b9909aaa49727b500221b4fdd46f5e1 100644 (file)
@@ -411,7 +411,10 @@ impl events::MessageSendEventsProvider for TestRoutingMessageHandler {
 
 pub struct TestLogger {
        level: Level,
+       #[cfg(feature = "std")]
        id: String,
+       #[cfg(not(feature = "std"))]
+       _id: String,
        pub lines: Mutex<HashMap<(String, String), usize>>,
 }
 
@@ -422,7 +425,10 @@ impl TestLogger {
        pub fn with_id(id: String) -> TestLogger {
                TestLogger {
                        level: Level::Trace,
+                       #[cfg(feature = "std")]
                        id,
+                       #[cfg(not(feature = "std"))]
+                       _id: id,
                        lines: Mutex::new(HashMap::new())
                }
        }