Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wusticality authored and MrGVSV committed May 1, 2023
1 parent cc4b5ec commit e9fd2a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bevy_proto_backend/src/proto/prototypes.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::borrow::{Borrow, Cow};

use crate::path::PathError;
use bevy::asset::{AssetServerError, Handle, HandleId, HandleUntyped, LoadState};
use bevy::ecs::system::SystemParam;
use bevy::prelude::{AssetServer, Res, ResMut};
use std::hash::Hash;
use thiserror::Error;
use crate::path::PathError;

use crate::proto::{ProtoStorage, Prototypical};
use crate::registration::ProtoRegistry;
Expand Down Expand Up @@ -65,12 +65,16 @@ impl<'w, T: Prototypical> PrototypesMut<'w, T> {
/// This will also store strong handles to the prototypes in order to keep them loaded.
///
/// To load without automatically storing the handles, try using [`AssetServer::load_folder`].
pub fn load_folder<P: Into<Cow<'static, str>>>(&mut self, path: P) -> Result<Vec<HandleUntyped>, ProtoLoadError> {
pub fn load_folder<P: Into<Cow<'static, str>>>(
&mut self,
path: P,
) -> Result<Vec<HandleUntyped>, ProtoLoadError> {
let path = path.into();
let handles: Vec<_> = self.asset_server.load_folder(path.as_ref())?;

for handle in &handles {
let path = self.asset_server
let path = self
.asset_server
.get_handle_path(handle)
.unwrap()
.path()
Expand Down

0 comments on commit e9fd2a0

Please sign in to comment.