Skip to content

Commit 936c724

Browse files
Fedeparma74ValuedMammal
authored andcommitted
fix(persisted): Make FutureResult non-Send when no-std
Previously, the `FutureResult` type always required the `Send` bound, which prevented `no_std` environments from using non-`Send` futures. With this change, the bound is applied only when the `std` feature is enabled.
1 parent 41c54da commit 936c724

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/wallet/persisted.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ pub trait WalletPersister {
5555
fn persist(persister: &mut Self, changeset: &ChangeSet) -> Result<(), Self::Error>;
5656
}
5757

58+
#[cfg(feature = "std")]
5859
type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>;
60+
#[cfg(not(feature = "std"))]
61+
type FutureResult<'a, T, E> = Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>;
5962

6063
/// Async trait that persists [`PersistedWallet`].
6164
///

0 commit comments

Comments
 (0)