bevy/crates
Brezak 90ce1ee07c
Add more methods to RelationshipSourceCollection (#18421)
# Objective

While working on #18058 I realized I could use
`RelationshipTargetCollection::new`, so I added it.

## Solution

- Add `RelationshipTargetCollection::new`
- Add `RelationshipTargetCollection::reserve`. Could generally be useful
when doing micro-optimizations.
- Add `RelationshipTargetCollection::shrink_to_fit`. Rust collections
generally don't shrink when removing elements. Might be a good idea to
call this once in a while.

## Testing

`cargo clippy`

---

## Showcase

`RelationshipSourceCollection` now implements `new`, `reserve` and
`shrink_to_fit` to give greater control over how much memory it
consumes.

## Migration Guide

Any type implementing `RelationshipSourceCollection` now needs to also
implement `new`, `reserve` and `shrink_to_fit`. `reserve` and
`shrink_to_fit` can be made no-ops if they conceptually mean nothing to
a collection.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
2025-03-20 01:35:51 +00:00
..
bevy_a11y bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_animation bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_anti_aliasing Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
bevy_app Unify and simplify command and system error handling (#18351) 2025-03-18 19:27:50 +00:00
bevy_asset bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_audio bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_color bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_core_pipeline Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
bevy_derive Link iOS example with rustc, and avoid C trampoline (#14780) 2025-03-17 21:14:07 +00:00
bevy_dev_tools Generic system config (#17962) 2025-03-12 00:12:30 +00:00
bevy_diagnostic Add process cpu/memory usage to SystemInformationDiagnosticsPlugin (#18279) 2025-03-16 21:14:46 +00:00
bevy_dylib enable std when building bevy_dylib (#18405) 2025-03-19 00:49:26 +00:00
bevy_ecs Add more methods to RelationshipSourceCollection (#18421) 2025-03-20 01:35:51 +00:00
bevy_encase_derive Internalize BevyManifest logic. Switch to RwLock (#18263) 2025-03-12 00:46:01 +00:00
bevy_gilrs Replace some !Send resources with thread_local! (#17730) 2025-03-04 07:48:02 +00:00
bevy_gizmos Extract sprites into a Vec (#17619) 2025-03-18 00:48:33 +00:00
bevy_gltf Gltf handle missing bindposes (#18419) 2025-03-19 21:45:05 +00:00
bevy_image remove circular dependency between bevy_sprite and bevy_image (#18379) 2025-03-18 01:38:49 +00:00
bevy_input bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_input_focus bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_internal Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
bevy_log Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_macro_utils Switch to ImDocument in BevyManifest (#18272) 2025-03-12 20:15:39 +00:00
bevy_math bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_mesh bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_mikktspace Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_pbr Add bevy_anti_aliasing (#18323) 2025-03-19 18:40:32 +00:00
bevy_picking Unify picking backends (#17348) 2025-03-18 19:24:43 +00:00
bevy_platform_support Remove example causing circular dependency in bevy_platform_support (#18390) 2025-03-18 08:58:52 +00:00
bevy_ptr moved Debug from derive to impl_ptr in bevy_ptr (#18042) 2025-02-28 02:54:46 +00:00
bevy_reflect Fixed Reflect derive macro on empty enums (#18277) (#18298) 2025-03-17 18:13:55 +00:00
bevy_remote FilteredResource returns a Result instead of a simple Option (#18265) 2025-03-17 18:54:13 +00:00
bevy_render Force serial command encoding on Linux/amdvlk (#18368) 2025-03-18 03:16:38 +00:00
bevy_scene Fix dynamic scene resources not being entity mapped (#18395) 2025-03-18 20:04:55 +00:00
bevy_sprite Fix unecessary specialization checks for apps with many materials (#18410) 2025-03-19 06:22:39 +00:00
bevy_state bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_tasks Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
bevy_text Extract sprites into a Vec (#17619) 2025-03-18 00:48:33 +00:00
bevy_time bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_transform Revert "Transform Propagation Optimization: Static Subtree Marking (#18094)" (#18363) 2025-03-17 20:01:29 +00:00
bevy_ui Unified picking cleanup (#18401) 2025-03-18 20:28:03 +00:00
bevy_utils Automatically enable portable-atomic when required (#17570) 2025-02-24 20:52:46 +00:00
bevy_window bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bevy_winit bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00