fix: add cfg to IntoFuture preventing Send (#2086)

This commit is contained in:
Matthias Seitz 2023-01-30 21:06:34 +01:00 committed by GitHub
parent 9ebc5b378c
commit 60e1779626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -228,6 +228,11 @@ where
D: Detokenize + Send + Sync, D: Detokenize + Send + Sync,
{ {
type Output = Result<D, ContractError<M>>; type Output = Result<D, ContractError<M>>;
#[cfg(target_arch = "wasm32")]
type IntoFuture = Pin<Box<dyn Future<Output = Self::Output>>>;
#[cfg(not(target_arch = "wasm32"))]
type IntoFuture = Pin<Box<dyn Future<Output = Self::Output> + Send>>; type IntoFuture = Pin<Box<dyn Future<Output = Self::Output> + Send>>;
fn into_future(self) -> Self::IntoFuture { fn into_future(self) -> Self::IntoFuture {