From e35751554ac82f5f0af02e9690458f0953e09380 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 21 Oct 2026 09:12:45 +0200 Subject: refactor(engine): replace Asset::dependencies fn with visit_dependencies fn --- engine/src/material.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engine/src/material.rs') diff --git a/engine/src/material.rs b/engine/src/material.rs index ae0751b..ded30a2 100644 --- a/engine/src/material.rs +++ b/engine/src/material.rs @@ -57,14 +57,14 @@ impl Default for Material impl Asset for Material { - fn dependencies(&self) -> impl Iterator> + fn visit_dependencies<'this>( + &'this self, + func: &mut dyn FnMut(AssetDependency<'this>), + ) { - self.loading_textures.iter().map(|(_, texture_label)| { - AssetDependency::new::(AssetLabel { - path: (&*texture_label.path).into(), - name: texture_label.name.as_deref().map(Into::into), - }) - }) + for (_, texture_label) in &self.loading_textures { + func(AssetDependency::new::(texture_label.borrow())); + } } } -- cgit v1.2.3-18-g5258