bevy/crates
Brezak 0f446d49a1 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-24 00:09:29 +01:00
..
bevy_a11y Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_animation Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_app Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_asset Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_audio Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_color Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_core_pipeline Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_derive Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_dev_tools Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_diagnostic Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_dylib enable std when building bevy_dylib (#18405) 2025-03-19 08:03:12 +01:00
bevy_ecs Add more methods to RelationshipSourceCollection (#18421) 2025-03-24 00:09:29 +01:00
bevy_encase_derive Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_gilrs Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_gizmos Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_gltf Gltf handle missing bindposes (#18419) 2025-03-24 00:09:29 +01:00
bevy_image Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_input Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_input_focus Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_internal Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_log Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_macro_utils Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_math Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_mesh Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_mikktspace Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_pbr Fix specialize_shadows system ordering (#18412) 2025-03-19 21:36:18 +01:00
bevy_picking Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_platform_support Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_ptr Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_reflect Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_remote Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_render Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_scene Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_sprite Fix unecessary specialization checks for apps with many materials (#18410) 2025-03-19 21:36:18 +01:00
bevy_state Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_tasks Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_text Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_time Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_transform Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_ui Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_utils Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_window Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00
bevy_winit Release 0.16.0-rc.1 2025-03-18 21:48:22 +01:00