From dc0a3a9acf8f221e87946322f0b3e0f77301021d Mon Sep 17 00:00:00 2001 From: Yutao Yuan Date: Wed, 4 May 2022 19:49:33 +0800 Subject: [PATCH] Make public macros more robust with $crate --- crates/bevy_asset/src/assets.rs | 8 ++++---- crates/bevy_utils/src/label.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bevy_asset/src/assets.rs b/crates/bevy_asset/src/assets.rs index a90afe5f20803..0a111ffbd8867 100644 --- a/crates/bevy_asset/src/assets.rs +++ b/crates/bevy_asset/src/assets.rs @@ -356,8 +356,8 @@ macro_rules! load_internal_asset { { let mut debug_app = $app .world - .non_send_resource_mut::(); - bevy_asset::debug_asset_server::register_handle_with_loader( + .non_send_resource_mut::<$crate::debug_asset_server::DebugAssetApp>(); + $crate::debug_asset_server::register_handle_with_loader( $loader, &mut debug_app, $handle, @@ -365,7 +365,7 @@ macro_rules! load_internal_asset { $path_str, ); } - let mut assets = $app.world.resource_mut::>(); + let mut assets = $app.world.resource_mut::<$crate::Assets<_>>(); assets.set_untracked($handle, ($loader)(include_str!($path_str))); }}; } @@ -374,7 +374,7 @@ macro_rules! load_internal_asset { #[macro_export] macro_rules! load_internal_asset { ($app: ident, $handle: ident, $path_str: expr, $loader: expr) => {{ - let mut assets = $app.world.resource_mut::>(); + let mut assets = $app.world.resource_mut::<$crate::Assets<_>>(); assets.set_untracked($handle, ($loader)(include_str!($path_str))); }}; } diff --git a/crates/bevy_utils/src/label.rs b/crates/bevy_utils/src/label.rs index 7728ef8b947df..e161aa5fbe935 100644 --- a/crates/bevy_utils/src/label.rs +++ b/crates/bevy_utils/src/label.rs @@ -60,7 +60,7 @@ macro_rules! define_label { ($label_trait_name:ident) => { /// Defines a set of strongly-typed labels for a class of objects pub trait $label_trait_name: - ::bevy_utils::label::DynHash + ::std::fmt::Debug + Send + Sync + 'static + $crate::label::DynHash + ::std::fmt::Debug + Send + Sync + 'static { #[doc(hidden)] fn dyn_clone(&self) -> Box;