diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs index c0bbb94b41e..f58a829c1d8 100644 --- a/lightning/src/sign/mod.rs +++ b/lightning/src/sign/mod.rs @@ -1041,7 +1041,7 @@ pub trait ChangeDestinationSource { /// /// This method should return a different value each time it is called, to avoid linking /// on-chain funds controlled to the same user. - fn get_change_destination_script<'a>(&self) -> AsyncResult<'a, ScriptBuf>; + fn get_change_destination_script<'a>(&'a self) -> AsyncResult<'a, ScriptBuf>; } /// A synchronous helper trait that describes an on-chain wallet capable of returning a (change) destination script. @@ -1073,7 +1073,7 @@ impl ChangeDestinationSource for ChangeDestinationSourceSyncWrapper where T::Target: ChangeDestinationSourceSync, { - fn get_change_destination_script<'a>(&self) -> AsyncResult<'a, ScriptBuf> { + fn get_change_destination_script<'a>(&'a self) -> AsyncResult<'a, ScriptBuf> { let script = self.0.get_change_destination_script(); Box::pin(async move { script }) } diff --git a/lightning/src/util/async_poll.rs b/lightning/src/util/async_poll.rs index 7c070f33e1c..3edfd5211fe 100644 --- a/lightning/src/util/async_poll.rs +++ b/lightning/src/util/async_poll.rs @@ -92,25 +92,29 @@ pub(crate) fn dummy_waker() -> Waker { unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &DUMMY_WAKER_VTABLE)) } } -/// A type alias for a future that returns a result of type T. #[cfg(feature = "std")] +/// A type alias for a future that returns a result of type T. pub type AsyncResult<'a, T> = Pin> + 'a + Send>>; #[cfg(not(feature = "std"))] +/// A type alias for a future that returns a result of type T. pub type AsyncResult<'a, T> = Pin> + 'a>>; -// Marker trait to optionally implement `Sync` under std. +/// Marker trait to optionally implement `Sync` under std. #[cfg(feature = "std")] pub use core::marker::Sync as MaybeSync; #[cfg(not(feature = "std"))] +/// Marker trait to optionally implement `Sync` under std. pub trait MaybeSync {} #[cfg(not(feature = "std"))] impl MaybeSync for T where T: ?Sized {} -// Marker trait to optionally implement `Send` under std. +/// Marker trait to optionally implement `Send` under std. #[cfg(feature = "std")] pub use core::marker::Send as MaybeSend; + #[cfg(not(feature = "std"))] +/// Marker trait to optionally implement `Send` under std. pub trait MaybeSend {} #[cfg(not(feature = "std"))] impl MaybeSend for T where T: ?Sized {} diff --git a/lightning/src/util/mod.rs b/lightning/src/util/mod.rs index 968f8222d9a..dcbea904b51 100644 --- a/lightning/src/util/mod.rs +++ b/lightning/src/util/mod.rs @@ -20,6 +20,7 @@ pub mod mut_global; pub mod anchor_channel_reserves; +pub mod async_poll; #[cfg(fuzzing)] pub mod base32; #[cfg(not(fuzzing))] @@ -33,7 +34,6 @@ pub mod ser; pub mod sweep; pub mod wakers; -pub(crate) mod async_poll; pub(crate) mod atomic_counter; pub(crate) mod byte_utils; pub mod hash_tables;