simplify conditional compilation and fix bug

This commit is contained in:
Brandon Thomas
2024-03-21 00:06:11 -04:00
parent ba97339b1b
commit 116079fc48
2 changed files with 3 additions and 3 deletions
+3 -1
View File
@@ -91,11 +91,13 @@ impl AssetReader for RemoteAssetReader {
let unboxed = async move {
self.load(path).await
};
if cfg!(headless_cli) {
if cfg!(not(feature = "wasm")) {
info!("wasm mode not detected");
// NB: Headless mode (server rendering) is running without a Tokio runtime.
// The reqwest HTTP client requires async-compat to function at runtime.
Box::pin(Compat::new(unboxed))
} else {
info!("wasm mode");
Box::pin(unboxed)
}
}