Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Make some asset loading functions monomorphic #1861

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions crates/bevy_asset/src/asset_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,11 @@ impl AssetServer {
}

// TODO: properly set failed LoadState in all failure cases
async fn load_async<'a, P: Into<AssetPath<'a>>>(
async fn load_async(
&self,
path: P,
asset_path: AssetPath<'_>,
force: bool,
) -> Result<AssetPathId, AssetServerError> {
let asset_path: AssetPath = path.into();
let asset_loader = self.get_path_asset_loader(asset_path.path())?;
let asset_path_id: AssetPathId = asset_path.get_id();

Expand Down Expand Up @@ -326,16 +325,11 @@ impl AssetServer {
}

pub fn load_untyped<'a, P: Into<AssetPath<'a>>>(&self, path: P) -> HandleUntyped {
let handle_id = self.load_untracked(path, false);
let handle_id = self.load_untracked(path.into(), false);
self.get_handle_untyped(handle_id)
}

pub(crate) fn load_untracked<'a, P: Into<AssetPath<'a>>>(
&self,
path: P,
force: bool,
) -> HandleId {
let asset_path: AssetPath<'a> = path.into();
pub(crate) fn load_untracked(&self, asset_path: AssetPath<'_>, force: bool) -> HandleId {
let server = self.clone();
let owned_path = asset_path.to_owned();
self.server
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_asset/src/io/file_asset_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn filesystem_watcher_system(asset_server: Res<AssetServer>) {
for path in paths.iter() {
if !changed.contains(path) {
let relative_path = path.strip_prefix(&asset_io.root_path).unwrap();
let _ = asset_server.load_untracked(relative_path, true);
let _ = asset_server.load_untracked(relative_path.into(), true);
}
}
changed.extend(paths);
Expand Down