bevy/crates/bevy_asset/src
Mark Nokalt 306c1ac617 Rename Handle::as_weak() to cast_weak() (#5321)
# Objective

Following discussion on #3536 and #3522, `Handle::as_weak()` takes a type `U`, reinterpreting the handle as of another asset type while keeping the same ID. This is mainly used today in font atlas code. This PR does two things:

- Rename the method to `cast_weak()` to make its intent more clear
- Actually change the type uuid in the handle if it's not an asset path variant.

## Migration Guide

- Rename `Handle::as_weak` uses to `Handle::cast_weak`

    The method now properly sets the associated type uuid if the handle is a direct reference (e.g. not a reference to an `AssetPath`), so adjust you code accordingly if you relied on the previous behavior.
2022-10-28 22:43:14 +00:00
..
diagnostic docs: Full documentation for bevy_asset (#3536) 2022-07-12 15:44:09 +00:00
io Add warning when using load_folder on web (#5827) 2022-08-29 22:26:43 +00:00
asset_server.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
assets.rs add ReflectAsset and ReflectHandle (#5923) 2022-10-28 20:42:33 +00:00
debug_asset_server.rs Plugins own their settings. Rework PluginGroup trait. (#6336) 2022-10-24 21:20:33 +00:00
filesystem_watcher.rs Update to notify 5.0 stable (#5865) 2022-09-02 15:54:54 +00:00
handle.rs Rename Handle::as_weak() to cast_weak() (#5321) 2022-10-28 22:43:14 +00:00
info.rs docs: Full documentation for bevy_asset (#3536) 2022-07-12 15:44:09 +00:00
lib.rs add ReflectAsset and ReflectHandle (#5923) 2022-10-28 20:42:33 +00:00
loader.rs Export anyhow::error for custom asset loaders (#5359) 2022-07-20 14:14:30 +00:00
path.rs Add From<String> for AssetPath<'a> (#6337) 2022-10-24 14:14:24 +00:00
reflect.rs add ReflectAsset and ReflectHandle (#5923) 2022-10-28 20:42:33 +00:00