Skip to content

Commit 822ad88

Browse files
committed
Make FutureSpawner only require Send + Sync in std builds
We only require `Send + Sync` on the `Future`s which are spawned in std builds, so its weird to require them on the trait itself in all builds. Instead, make them consistent.
1 parent 6d3436e commit 822ad88

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/util/native_async.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
//! This module contains a few public utility which are used to run LDK in a native Rust async
88
//! environment.
99
10-
use crate::util::async_poll::MaybeSend;
10+
use crate::util::async_poll::{MaybeSend, MaybeSync};
11+
1112
use core::future::Future;
1213

1314
/// A generic trait which is able to spawn futures in the background.
14-
pub trait FutureSpawner: Send + Sync + 'static {
15+
pub trait FutureSpawner: MaybeSend + MaybeSync + 'static {
1516
/// Spawns the given future as a background task.
1617
///
1718
/// This method MUST NOT block on the given future immediately.

0 commit comments

Comments
 (0)