Skip to content

Commit

Permalink
wip: make load_bunch compile
Browse files Browse the repository at this point in the history
  • Loading branch information
berkus committed Apr 2, 2024
1 parent 07806cc commit 1b60015
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use {
use bevy::app::AppExit;

#[throws]
fn load_bunch<T: LoadMany<Outputs = T> + NamedResource>(
fn load_bunch<T: LoadMany<Outputs = Box<T>> + NamedResource>(
paths: &[&str],
ext: &str,
map: &mut HashMap<String, Box<T>>,
Expand All @@ -70,7 +70,9 @@ fn load_bunch<T: LoadMany<Outputs = T> + NamedResource>(
if file_type.is_file() && fname.ends_with(ext) {
for v in T::load_many(fname)? {
map.entry(v.resource_name())
.and_modify(|m: &mut V| error!("{} already exists", m.resource_name()))
.and_modify(|m: &mut Box<T>| {
error!("{} already exists", m.resource_name())
})
.or_insert(v);
}
}
Expand Down

0 comments on commit 1b60015

Please sign in to comment.