Skip to content

Commit 6df50e0

Browse files
committed
f Drop explicit no-std feature
.. by making `hashbrown` a required dependency, just like we did in `lightning`.
1 parent 15c565f commit 6df50e0

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

lightning-liquidity/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ categories = ["cryptography::cryptocurrencies"]
1616
[features]
1717
default = ["std"]
1818
std = ["lightning/std", "bitcoin/std", "lightning-invoice/std"]
19-
no-std = ["hashbrown"]
2019

2120
[dependencies]
2221
lightning = { version = "0.0.124", path = "../lightning", default-features = false }
2322
lightning-types = { version = "0.1", path = "../lightning-types", default-features = false }
2423
lightning-invoice = { version = "0.32.0", path = "../lightning-invoice", default-features = false, features = ["serde"] }
2524

2625
bitcoin = { version = "0.32.2", default-features = false, features = ["serde"] }
27-
hashbrown = { version = "0.8", optional = true }
26+
hashbrown = { version = "0.8" }
2827

2928
chrono = { version = "0.4", default-features = false, features = ["serde", "alloc"] }
3029
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }

lightning-liquidity/src/lib.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,14 @@
1818
#![allow(clippy::drop_non_drop)]
1919
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2020
#![cfg_attr(not(feature = "std"), no_std)]
21-
#[cfg(not(any(feature = "std", feature = "no-std")))]
22-
compile_error!("at least one of the `std` or `no-std` features must be enabled");
2321

2422
#[macro_use]
2523
extern crate alloc;
2624

2725
mod prelude {
2826
#![allow(unused_imports)]
29-
#[cfg(feature = "hashbrown")]
30-
extern crate hashbrown;
31-
32-
#[cfg(feature = "hashbrown")]
33-
pub use self::hashbrown::{hash_map, HashMap, HashSet};
3427
pub use alloc::{boxed::Box, collections::VecDeque, string::String, vec, vec::Vec};
35-
#[cfg(not(feature = "hashbrown"))]
36-
pub use std::collections::{hash_map, HashMap, HashSet};
28+
pub use hashbrown::{hash_map, HashMap, HashSet};
3729

3830
pub use alloc::borrow::ToOwned;
3931
pub use alloc::string::ToString;

lightning-liquidity/src/manager.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ where {
361361
/// ```
362362
///
363363
/// [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
364-
#[cfg(feature = "no-std")]
364+
#[cfg(not(feature = "std"))]
365365
pub fn set_process_msgs_callback(&self, callback: impl Fn() + 'static) {
366366
self.pending_messages.set_process_msgs_callback(callback)
367367
}

lightning-liquidity/src/message_queue.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct MessageQueue {
1313
queue: Mutex<VecDeque<(PublicKey, LSPSMessage)>>,
1414
#[cfg(feature = "std")]
1515
process_msgs_callback: RwLock<Option<Box<dyn Fn() + Send + Sync + 'static>>>,
16-
#[cfg(feature = "no-std")]
16+
#[cfg(not(feature = "std"))]
1717
process_msgs_callback: RwLock<Option<Box<dyn Fn() + 'static>>>,
1818
}
1919

@@ -29,7 +29,7 @@ impl MessageQueue {
2929
*self.process_msgs_callback.write().unwrap() = Some(Box::new(callback));
3030
}
3131

32-
#[cfg(feature = "no-std")]
32+
#[cfg(not(feature = "std"))]
3333
pub(crate) fn set_process_msgs_callback(&self, callback: impl Fn() + 'static) {
3434
*self.process_msgs_callback.write().unwrap() = Some(Box::new(callback));
3535
}

0 commit comments

Comments
 (0)