Skip to content

Commit

Permalink
asset: make HandleUntyped::id private
Browse files Browse the repository at this point in the history
  • Loading branch information
neocturne committed Jan 2, 2023
1 parent b027d40 commit 46dca4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions crates/bevy_asset/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ impl<T: Asset> Clone for Handle<T> {
/// To convert back to a typed handle, use the [typed](HandleUntyped::typed) method.
#[derive(Debug)]
pub struct HandleUntyped {
/// An unique identifier to an Asset.
pub id: HandleId,
id: HandleId,
handle_type: HandleType,
}

Expand Down Expand Up @@ -352,6 +351,12 @@ impl HandleUntyped {
}
}

/// The ID of the asset.
#[inline]
pub fn id(&self) -> HandleId {
self.id
}

/// Creates a weak copy of this handle.
#[must_use]
pub fn clone_weak(&self) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions examples/2d/texture_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ fn check_textures(
rpg_sprite_handles: ResMut<RpgSpriteHandles>,
asset_server: Res<AssetServer>,
) {
if let LoadState::Loaded =
asset_server.get_group_load_state(rpg_sprite_handles.handles.iter().map(|handle| handle.id))
if let LoadState::Loaded = asset_server
.get_group_load_state(rpg_sprite_handles.handles.iter().map(|handle| handle.id()))
{
state.set(AppState::Finished).unwrap();
}
Expand Down

0 comments on commit 46dca4d

Please sign in to comment.