bevy/crates/bevy_asset/src
andriyDev ed1143b26b
Make adding a subasset label return a result for if there is a duplicate label. (#18013)
# Objective

- Makes #18010 more easily debuggable. This doesn't solve that issue,
but protects us from it in the future.

## Solution

- Make `LoadContext::add_labeled_asset` and friends return an error if
it finds a duplicate asset.

## Testing

- Added a test - it fails before the fix.

---

## Migration Guide

- `AssetLoader`s must now handle the case of a duplicate subasset label
when using `LoadContext::add_labeled_asset` and its variants. If you
know your subasset labels are unique by construction (e.g., they include
an index number), you can simply unwrap this result.
2025-02-24 21:51:40 +00:00
..
io Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
processor Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
server Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
asset_changed.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
assets.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
direct_access_ext.rs Improve clarity of existing bevy_assets documentation (#17830) 2025-02-13 19:49:25 +00:00
event.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
folder.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
handle.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
id.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
lib.rs Make adding a subasset label return a result for if there is a duplicate label. (#18013) 2025-02-24 21:51:40 +00:00
loader_builders.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
loader.rs Make adding a subasset label return a result for if there is a duplicate label. (#18013) 2025-02-24 21:51:40 +00:00
meta.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
path.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
reflect.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
render_asset.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
saver.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
transformer.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00