Fix compilation error on wasm (#549)

Fix compilation error on wasm
This commit is contained in:
Stjepan Glavina 2020-09-22 00:47:38 +02:00 committed by GitHub
parent b5f3585d2e
commit 74f881f20d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -55,6 +55,13 @@ jobs:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Check wasm
uses: actions-rs/cargo@v1
with:
command: check
target: wasm32-unknown-unknown
override: true
clean:
runs-on: ubuntu-latest
steps:

View File

@ -1,7 +1,6 @@
use std::{
future::Future,
mem,
pin::Pin,
sync::{Arc, Mutex},
};
@ -63,10 +62,12 @@ impl TaskPool {
F: FnOnce(&mut Scope<'scope, T>) + 'scope + Send,
T: Send + 'static,
{
let executor = async_executor::LocalExecutor::new();
let executor = &async_executor::LocalExecutor::new();
let executor: &'scope async_executor::LocalExecutor<'scope> =
unsafe { mem::transmute(executor) };
let mut scope = Scope {
executor: &executor,
executor,
results: Vec::new(),
};