use async compat

This commit is contained in:
Lee-Orr
2024-03-20 21:01:05 -04:00
parent 981949c4db
commit 485edf2dba
4 changed files with 19 additions and 3 deletions
Generated
+14
View File
@@ -305,6 +305,19 @@ dependencies = [
"futures-core",
]
[[package]]
name = "async-compat"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f68a707c1feb095d8c07f8a65b9f506b117d30af431cab89374357de7c11461b"
dependencies = [
"futures-core",
"futures-io",
"once_cell",
"pin-project-lite",
"tokio",
]
[[package]]
name = "async-executor"
version = "1.8.0"
@@ -4851,6 +4864,7 @@ name = "studio"
version = "0.1.0"
dependencies = [
"anyhow",
"async-compat",
"bevy",
"bevy-inspector-egui",
"bevy_mod_outline",
+1
View File
@@ -50,6 +50,7 @@ space_editor = {git = "https://github.com/rewin123/space_editor", rev = "ce83f86
anyhow.workspace = true
serde_repr = "0.1.18"
bevy_tweening = "0.9"
async-compat = "0.2"
[dependencies.reqwest]
version = "0.11.24"
+1 -1
View File
@@ -41,7 +41,7 @@
"headless": {
"executor": "nx:run-commands",
"options": {
"command": "cargo run -p studio --bin studio-headless -- {args}"
"command": "cargo run -p studio --bin studio-headless --"
}
},
"test": {
+3 -2
View File
@@ -1,5 +1,6 @@
use std::{io::ErrorKind, path::Path};
use async_compat::Compat;
use bevy::{
asset::io::{AssetReader, AssetReaderError, PathStream, Reader, VecReader},
prelude::*,
@@ -22,7 +23,7 @@ impl AssetReader for RemoteAssetReader {
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
Box::pin(async move {
Box::pin(Compat::new(async move {
let token = path
.ext_file_prefix()
.ok_or_else(|| {
@@ -82,7 +83,7 @@ impl AssetReader for RemoteAssetReader {
let reader: Box<Reader> = Box::new(VecReader::new(bytes));
Ok(reader)
})
}))
}
fn read_meta<'a>(