Skip to content

Commit d317ae3

Browse files
committed
Remove futures feature
Now that we use core::future, the feature flag is no longer needed.
1 parent 493b686 commit d317ae3

File tree

5 files changed

+5
-19
lines changed

5 files changed

+5
-19
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
run: |
123123
cargo install cargo-llvm-cov
124124
export RUSTFLAGS="-Coverflow-checks=off"
125-
cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json
125+
cargo llvm-cov --features rest-client,rpc-client,tokio,serde --codecov --hide-instantiations --output-path=target/codecov.json
126126
# Could you use this to fake the coverage report for your PR? Sure.
127127
# Will anyone be impressed by your amazing coverage? No
128128
# Maybe if codecov wasn't broken we wouldn't need to do this...
@@ -232,13 +232,13 @@ jobs:
232232
- name: Run cargo check for release build.
233233
run: |
234234
cargo check --release
235-
cargo check --no-default-features --features=futures,std --release
235+
cargo check --no-default-features --features=std --release
236236
cargo doc --release
237237
- name: Run cargo check for Taproot build.
238238
run: |
239239
cargo check --release
240240
cargo check --no-default-features --release
241-
cargo check --no-default-features --features=futures,std --release
241+
cargo check --no-default-features --features=std --release
242242
cargo doc --release
243243
cargo doc --no-default-features --release
244244
env:

lightning-background-processor/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ all-features = true
1414
rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[features]
17-
futures = [ ]
1817
std = ["lightning/std", "lightning-liquidity/std", "bitcoin-io/std", "bitcoin_hashes/std"]
1918

2019
default = ["std"]

lightning-background-processor/src/lib.rs

-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![deny(rustdoc::broken_intra_doc_links)]
55
#![deny(rustdoc::private_intra_doc_links)]
66
#![deny(missing_docs)]
7-
#![cfg_attr(not(feature = "futures"), deny(unsafe_code))]
87
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
98
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
109

@@ -25,7 +24,6 @@ use lightning::chain::chainmonitor::{ChainMonitor, Persist};
2524
use lightning::events::EventHandler;
2625
#[cfg(feature = "std")]
2726
use lightning::events::EventsProvider;
28-
#[cfg(feature = "futures")]
2927
use lightning::events::ReplayEvent;
3028
use lightning::events::{Event, PathFailure};
3129

@@ -36,14 +34,12 @@ use lightning::onion_message::messenger::AOnionMessenger;
3634
use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
3735
use lightning::routing::scoring::{ScoreUpdate, WriteableScore};
3836
use lightning::routing::utxo::UtxoLookup;
39-
#[cfg(feature = "futures")]
4037
use lightning::sign::ChangeDestinationSource;
4138
#[cfg(feature = "std")]
4239
use lightning::sign::ChangeDestinationSourceSync;
4340
use lightning::sign::OutputSpender;
4441
use lightning::util::logger::Logger;
4542
use lightning::util::persist::{KVStore, Persister};
46-
#[cfg(feature = "futures")]
4743
use lightning::util::sweep::OutputSweeper;
4844
#[cfg(feature = "std")]
4945
use lightning::util::sweep::OutputSweeperSync;
@@ -146,7 +142,6 @@ const SWEEPER_TIMER: u64 = 30;
146142
#[cfg(test)]
147143
const SWEEPER_TIMER: u64 = 1;
148144

149-
#[cfg(feature = "futures")]
150145
/// core::cmp::min is not currently const, so we define a trivial (and equivalent) replacement
151146
const fn min_u64(a: u64, b: u64) -> u64 {
152147
if a < b {
@@ -155,7 +150,6 @@ const fn min_u64(a: u64, b: u64) -> u64 {
155150
b
156151
}
157152
}
158-
#[cfg(feature = "futures")]
159153
const FASTEST_TIMER: u64 = min_u64(
160154
min_u64(FRESHNESS_TIMER, PING_TIMER),
161155
min_u64(SCORER_PERSIST_TIMER, min_u64(FIRST_NETWORK_PRUNE_TIMER, REBROADCAST_TIMER)),
@@ -508,7 +502,6 @@ macro_rules! define_run_body {
508502
} }
509503
}
510504

511-
#[cfg(feature = "futures")]
512505
pub(crate) mod futures_util {
513506
use core::future::Future;
514507
use core::marker::Unpin;
@@ -622,9 +615,7 @@ pub(crate) mod futures_util {
622615
unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &DUMMY_WAKER_VTABLE)) }
623616
}
624617
}
625-
#[cfg(feature = "futures")]
626618
use core::task;
627-
#[cfg(feature = "futures")]
628619
use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
629620

630621
/// Processes background events in a future.
@@ -775,7 +766,6 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
775766
#[cfg_attr(feature = "std", doc = " handle.await.unwrap()")]
776767
/// # }
777768
///```
778-
#[cfg(feature = "futures")]
779769
pub async fn process_events_async<
780770
'a,
781771
UL: 'static + Deref,
@@ -2100,7 +2090,6 @@ mod tests {
21002090
}
21012091

21022092
#[tokio::test]
2103-
#[cfg(feature = "futures")]
21042093
async fn test_channel_manager_persist_error_async() {
21052094
// Test that if we encounter an error during manager persistence, the thread panics.
21062095
let (_, nodes) = create_nodes(2, "test_persist_error_sync");
@@ -2609,7 +2598,6 @@ mod tests {
26092598
}
26102599

26112600
#[tokio::test]
2612-
#[cfg(feature = "futures")]
26132601
async fn test_not_pruning_network_graph_until_graph_sync_completion_async() {
26142602
let (sender, receiver) = std::sync::mpsc::sync_channel(1);
26152603

@@ -2812,7 +2800,6 @@ mod tests {
28122800
}
28132801

28142802
#[tokio::test]
2815-
#[cfg(feature = "futures")]
28162803
async fn test_payment_path_scoring_async() {
28172804
let (sender, mut receiver) = tokio::sync::mpsc::channel(1);
28182805
let event_handler = move |event: Event| {

msrv-no-dev-deps-check/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ lightning-block-sync = { path = "../lightning-block-sync", features = [ "rest-cl
99
lightning-invoice = { path = "../lightning-invoice" }
1010
lightning-net-tokio = { path = "../lightning-net-tokio" }
1111
lightning-persister = { path = "../lightning-persister" }
12-
lightning-background-processor = { path = "../lightning-background-processor", features = ["futures"] }
12+
lightning-background-processor = { path = "../lightning-background-processor" }
1313
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync" }
1414
lightning-custom-message = { path = "../lightning-custom-message" }

no-std-check/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ default = []
1010
lightning = { path = "../lightning", default-features = false }
1111
lightning-invoice = { path = "../lightning-invoice", default-features = false }
1212
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync", default-features = false }
13-
lightning-background-processor = { path = "../lightning-background-processor", features = ["futures"], default-features = false }
13+
lightning-background-processor = { path = "../lightning-background-processor", default-features = false }

0 commit comments

Comments
 (0)