Skip to content

Commit 59925e0

Browse files
authored
refactor: remove async-compat, as it is no longer needed (#17)
The Bevy MSRV is above 1.79, effectively removing the friction between old async executors (futures and tokio). Async compat is no longer necessary.
1 parent b7ead06 commit 59925e0

3 files changed

Lines changed: 2 additions & 10 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ bevy = { version = "0.17.2", default-features = false, features = [
8484

8585
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
8686
futures-timer = "3.0.3"
87-
async-compat = "0.2.5"
8887

8988
[target.'cfg(target_arch = "wasm32")'.dependencies]
9089
futures-timer = { version = "3.0.3", features = ["wasm-bindgen"] }

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
[![Discord](https://img.shields.io/discord/913957940560531456.svg?label=Loopy&logo=discord&logoColor=ffffff&color=ffffff&labelColor=000000)](https://discord.gg/zrjnQzdjCB)
66
![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)
7-
[![Build status](https://github.com/loopystudios/bevy_async_task/workflows/CI/badge.svg)](https://github.com/loopystudios/bevy_async_task/actions)
7+
[![Following released Bevy versions](https://img.shields.io/badge/bevy%20tracking-released%20version-lightblue)](https://bevyengine.org/learn/quick-start/plugin-development/#main-branch-tracking)\
88
[![Dependency status](https://deps.rs/repo/github/loopystudios/bevy_async_task/status.svg)](https://deps.rs/repo/github/loopystudios/bevy_async_task)
99
[![crates.io](https://img.shields.io/crates/v/bevy_async_task.svg)](https://crates.io/crates/bevy_async_task)
1010
[![docs.rs](https://img.shields.io/docsrs/bevy_async_task)](https://docs.rs/bevy_async_task)
11+
[![Build status](https://github.com/loopystudios/bevy_async_task/workflows/CI/badge.svg)](https://github.com/loopystudios/bevy_async_task/actions)
1112

1213
A minimum crate for ergonomic abstractions to async programming in Bevy. There is full API support for **wasm** and **native**. Android and iOS are untested (Help needed).
1314

src/task.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ use std::sync::atomic::AtomicBool;
77
use std::sync::atomic::Ordering;
88
use std::task::Poll;
99

10-
#[cfg(not(target_arch = "wasm32"))]
11-
use async_compat::CompatExt;
1210
use bevy_tasks::ConditionalSend;
1311
use bevy_tasks::ConditionalSendFuture;
1412
use futures::task::AtomicWaker;
@@ -93,10 +91,7 @@ where
9391
let waker = waker.clone();
9492
let received = received.clone();
9593
async move {
96-
#[cfg(target_arch = "wasm32")]
9794
let result = self.fut.await;
98-
#[cfg(not(target_arch = "wasm32"))]
99-
let result = self.fut.compat().await;
10095

10196
if let Ok(()) = tx.send(result) {
10297
// Wait for the receiver to get the result before dropping.
@@ -193,10 +188,7 @@ where
193188
let waker = waker.clone();
194189
let received = received.clone();
195190
async move {
196-
#[cfg(target_arch = "wasm32")]
197191
let result = timeout(self.timeout, self.fut).await;
198-
#[cfg(not(target_arch = "wasm32"))]
199-
let result = timeout(self.timeout, self.fut.compat()).await;
200192

201193
if let Ok(()) = tx.send(result) {
202194
// Wait for the receiver to get the result before dropping.

0 commit comments

Comments
 (0)