diff --git a/bevy_asset_loader/examples/asset_maps.rs b/bevy_asset_loader/examples/asset_maps.rs index 2b6a95d..ed05dfa 100644 --- a/bevy_asset_loader/examples/asset_maps.rs +++ b/bevy_asset_loader/examples/asset_maps.rs @@ -23,10 +23,10 @@ struct AudioAssets { full_path: HashMap>, // `FileName` as the key will use the file name (strip away any directories in the path) #[asset(path = "audio", collection(mapped, typed))] - file_name: HashMap>, + file_name: HashMap>, // `FileStem` as the key will use the file name without the extension #[asset(path = "audio", collection(mapped, typed))] - file_stem: HashMap>, + file_stem: HashMap>, // `AssetLabel` as the key uses the label (part after the `#` here) // This will panic if an asset in the collection has no label! #[asset( diff --git a/bevy_asset_loader/src/lib.rs b/bevy_asset_loader/src/lib.rs index b01c21d..4bee852 100644 --- a/bevy_asset_loader/src/lib.rs +++ b/bevy_asset_loader/src/lib.rs @@ -97,7 +97,7 @@ pub mod prelude { DynamicAssets, }, loading_state::{LoadingState, LoadingStateAppExt, LoadingStateSet}, - mapped::{AssetLabel, FileName, FileStem, MapKey}, + mapped::{AssetLabel, AssetFileName, AssetFileStem, MapKey}, }; } diff --git a/bevy_asset_loader/src/mapped.rs b/bevy_asset_loader/src/mapped.rs index 537261a..578af67 100644 --- a/bevy_asset_loader/src/mapped.rs +++ b/bevy_asset_loader/src/mapped.rs @@ -57,7 +57,7 @@ macro_rules! impl_map_key_extras { /// /// # Key collision /// -/// Since [`FileName`] uses a subset of the asset path, two different assets may have the same key. +/// Since [`AssetFileName`] uses a subset of the asset path, two different assets may have the same key. /// It’s up to you to ensure there is no collision. /// /// Here's an example that will result in a key clash. @@ -72,11 +72,11 @@ macro_rules! impl_map_key_extras { /// /// [`file_name`]: std::path::Path::file_name #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub struct FileName(Box); +pub struct AssetFileName(Box); -impl_map_key_extras!(FileName); +impl_map_key_extras!(AssetFileName); -impl MapKey for FileName { +impl MapKey for AssetFileName { #[inline] fn from_asset_path(path: &AssetPath) -> Self { Self( @@ -94,7 +94,7 @@ impl MapKey for FileName { /// /// # Key collision /// -/// Since [`FileStem`] uses a subset of the asset path, two different assets may have the same key. +/// Since [`AssetFileStem`] uses a subset of the asset path, two different assets may have the same key. /// It’s up to you to ensure there is no collision. /// /// Here's an example that will result in a key clash. @@ -107,11 +107,11 @@ impl MapKey for FileName { /// /// [`file_stem`]: std::path::Path::file_stem #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub struct FileStem(Box); +pub struct AssetFileStem(Box); -impl_map_key_extras!(FileStem); +impl_map_key_extras!(AssetFileStem); -impl MapKey for FileStem { +impl MapKey for AssetFileStem { #[inline] fn from_asset_path(path: &AssetPath) -> Self { Self(