Skip to content

Commit

Permalink
fix: remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
TekhnaeRaav committed Jun 25, 2024
1 parent 55609e9 commit cfa84f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 6 additions & 4 deletions framework_crates/bones_bevy_renderer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use bevy::{
tasks::IoTaskPool,
utils::Instant,
};
use std::path::PathBuf;
use std::path::{Path, PathBuf};

/// Renderer for [`bones_framework`] [`Game`][bones::Game]s using Bevy.
pub struct BonesBevyRenderer {
Expand Down Expand Up @@ -164,7 +164,7 @@ impl BonesBevyRenderer {

if let Some(mut asset_server) = self.game.shared_resource_mut::<bones::AssetServer>() {
asset_server.set_game_version(self.game_version);
asset_server.set_io(asset_io(self.asset_dir, self.packs_dir));
asset_server.set_io(asset_io(&self.asset_dir, &self.packs_dir));

if self.preload {
// Spawn the task to load game assets
Expand Down Expand Up @@ -272,13 +272,15 @@ fn assets_not_loaded(game: Res<BonesGame>) -> bool {
}

/// A [`bones::AssetIo`] configured for web and local file access
pub fn asset_io(asset_dir: PathBuf, packs_dir: PathBuf) -> impl bones::AssetIo + 'static {
pub fn asset_io(asset_dir: &Path, packs_dir: &Path) -> impl bones::AssetIo + 'static {
#[cfg(not(target_arch = "wasm32"))]
{
bones::FileAssetIo::new(&asset_dir, &packs_dir)
bones::FileAssetIo::new(asset_dir, packs_dir)
}
#[cfg(target_arch = "wasm32")]
{
let _ = asset_dir;
let _ = packs_dir;
let window = web_sys::window().unwrap();
let path = window.location().pathname().unwrap();
let base = path.rsplit_once('/').map(|x| x.0).unwrap_or(&path);
Expand Down
3 changes: 1 addition & 2 deletions framework_crates/bones_bevy_renderer/src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bevy::log::error;
use bones_framework::prelude::*;
use serde::{de::Visitor, Deserialize, Serialize};
use std::path::PathBuf;

#[cfg(target_arch = "wasm32")]
pub use wasm::StorageBackend;
Expand Down Expand Up @@ -55,7 +54,7 @@ mod native {
use super::*;

pub struct StorageBackend {
storage_path: PathBuf,
storage_path: std::path::PathBuf,
}

impl StorageBackend {
Expand Down

0 comments on commit cfa84f5

Please sign in to comment.