Skip to content

Commit

Permalink
Re-export futures_lite in bevy_tasks (#10670)
Browse files Browse the repository at this point in the history
# Objective

- Fixes #10664

## Solution

- `pub use futures_lite as future` :)

---

## Changelog

- Made `futures_lite` available as `future` in the `bevy_tasks` module.

## Migration Guide

- Remove `futures_lite` from `Cargo.toml`.

```diff
[dependencies]
bevy = "0.12.0"
- futures-lite = "1.4.0"
```

- Replace `futures_lite` imports with `bevy::tasks::future`.

```diff
- use futures_lite::poll_once;
+ use bevy::tasks::future::poll_once;
```
  • Loading branch information
BD103 authored Nov 21, 2023
1 parent e67cfdf commit 3578eec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_tasks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub use futures_lite::future::block_on;
mod iter;
pub use iter::ParallelIterator;

pub use futures_lite;

#[allow(missing_docs)]
pub mod prelude {
#[doc(hidden)]
Expand Down
3 changes: 1 addition & 2 deletions examples/async_tasks/async_compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

use bevy::{
prelude::*,
tasks::{block_on, AsyncComputeTaskPool, Task},
tasks::{block_on, futures_lite::future, AsyncComputeTaskPool, Task},
};
use futures_lite::future;
use rand::Rng;
use std::time::{Duration, Instant};

Expand Down

0 comments on commit 3578eec

Please sign in to comment.