Skip to content

Commit

Permalink
Fix up example's type signature for Bevy 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Cecile committed Jul 7, 2024
1 parent 1422f63 commit 42137ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/custom_asset_lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
//! As this example demonstrates, you can bypass the [`ManifestPlugin`](leafwing_manifest::plugin::ManifestPlugin) entirely, and load your assets however you like,
//! calling the publicly exposed methods yourself to replicate the work it does.
use std::future::Future;

use bevy::{
asset::{io::Reader, AssetLoader, AsyncReadExt, LoadContext, LoadState},
prelude::*,
utils::BoxedFuture,
utils::ConditionalSendFuture,
};
use bevy_common_assets::ron::RonLoaderError;
use leafwing_manifest::manifest::Manifest;
Expand Down Expand Up @@ -129,7 +131,9 @@ impl AssetLoader for ItemAssetLoader {
reader: &'a mut Reader,
_settings: &'a Self::Settings,
_load_context: &'a mut LoadContext,
) -> BoxedFuture<'a, Result<Self::Asset, Self::Error>> {
) -> impl ConditionalSendFuture
+ Future<Output = Result<<Self as AssetLoader>::Asset, <Self as AssetLoader>::Error>>
{
Box::pin(async move {
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await?;
Expand Down

0 comments on commit 42137ef

Please sign in to comment.