Skip to content

Commit

Permalink
Merge pull request #30 from danielfeather/main
Browse files Browse the repository at this point in the history
Update to Bevy 0.14
  • Loading branch information
johanhelsing authored Jul 16, 2024
2 parents 27f94fc + 4dccf49 commit ce9baea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ repository = "https://github.com/johanhelsing/bevy_web_asset"
version = "0.8.0"

[dependencies]
bevy = { version = "0.13.0", default-features = false, features = [
bevy = { version = "0.14", default-features = false, features = [
"bevy_asset",
] }
pin-project = "1.1.3"
pin-project = "1.1.5"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
surf = { version = "2.3", default-features = false, features = [
Expand All @@ -32,7 +32,7 @@ wasm-bindgen = { version = "0.2", default-features = false }
wasm-bindgen-futures = "0.4"

[dev-dependencies]
bevy = { version = "0.13.0", default-features = false, features = [
bevy = { version = "0.14", default-features = false, features = [
"bevy_asset",
"bevy_core_pipeline",
"bevy_sprite",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ I intend to support the latest bevy release in the `main` branch.

|bevy|bevy_web_asset|
|----|--------------|
|0.13|0.8, main |
|0.14|0.9, main |
|0.13|0.8 |
|0.12|0.7 |
|0.9 |0.5 |
|0.8 |0.4 |
Expand Down
24 changes: 10 additions & 14 deletions src/web_asset_source.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use bevy::asset::io::PathStream;
use bevy::utils::BoxedFuture;
use bevy::{asset::io::PathStream, utils::ConditionalSendFuture};
use std::path::{Path, PathBuf};

use bevy::asset::io::{AssetReader, AssetReaderError, Reader};
Expand Down Expand Up @@ -157,29 +156,26 @@ impl AssetReader for WebAssetReader {
fn read<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
Box::pin(get(self.make_uri(path)))
) -> impl ConditionalSendFuture<Output = Result<Box<Reader<'a>>, AssetReaderError>> {
get(self.make_uri(path))
}

fn read_meta<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
Box::pin(get(self.make_meta_uri(path)))
) -> impl ConditionalSendFuture<Output = Result<Box<Reader<'a>>, AssetReaderError>> {
get(self.make_meta_uri(path))
}

fn is_directory<'a>(
&'a self,
_path: &'a Path,
) -> BoxedFuture<'a, Result<bool, AssetReaderError>> {
Box::pin(async { Ok(false) })
async fn is_directory<'a>(&'a self, _path: &'a Path) -> Result<bool, AssetReaderError> {
Ok(false)
}

fn read_directory<'a>(
async fn read_directory<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<PathStream>, AssetReaderError>> {
Box::pin(async { Err(AssetReaderError::NotFound(self.make_uri(path))) })
) -> Result<Box<PathStream>, AssetReaderError> {
Err(AssetReaderError::NotFound(self.make_uri(path)))
}
}

Expand Down

0 comments on commit ce9baea

Please sign in to comment.