-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize memory size of SparseArray and integer-based ECS IDs #3678
Commits on Jan 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6620dd9 - Browse repository at this point
Copy the full SHA 6620dd9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37bd31f - Browse repository at this point
Copy the full SHA 37bd31fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 28fe7a0 - Browse repository at this point
Copy the full SHA 28fe7a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8bca091 - Browse repository at this point
Copy the full SHA 8bca091View commit details -
Configuration menu - View commit details
-
Copy full SHA for f01f1d2 - Browse repository at this point
Copy the full SHA f01f1d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2ebb01 - Browse repository at this point
Copy the full SHA d2ebb01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c2525c - Browse repository at this point
Copy the full SHA 1c2525cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6aa4a97 - Browse repository at this point
Copy the full SHA 6aa4a97View commit details
Commits on Jan 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ab57a2b - Browse repository at this point
Copy the full SHA ab57a2bView commit details
Commits on Jan 27, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 85fc10c - Browse repository at this point
Copy the full SHA 85fc10cView commit details -
Configuration menu - View commit details
-
Copy full SHA for eea5465 - Browse repository at this point
Copy the full SHA eea5465View commit details
Commits on Mar 6, 2022
-
Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 41d7c08 - Browse repository at this point
Copy the full SHA 41d7c08View commit details -
Configuration menu - View commit details
-
Copy full SHA for db30528 - Browse repository at this point
Copy the full SHA db30528View commit details -
Configuration menu - View commit details
-
Copy full SHA for 351ffea - Browse repository at this point
Copy the full SHA 351ffeaView commit details -
Configuration menu - View commit details
-
Copy full SHA for f01b97a - Browse repository at this point
Copy the full SHA f01b97aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 692b4a0 - Browse repository at this point
Copy the full SHA 692b4a0View commit details
Commits on Mar 7, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 307775e - Browse repository at this point
Copy the full SHA 307775eView commit details
Commits on May 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 1e19f0e - Browse repository at this point
Copy the full SHA 1e19f0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ceeea05 - Browse repository at this point
Copy the full SHA ceeea05View commit details
Commits on May 22, 2022
-
Configuration menu - View commit details
-
Copy full SHA for a1bd8c4 - Browse repository at this point
Copy the full SHA a1bd8c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd34430 - Browse repository at this point
Copy the full SHA fd34430View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77f9a15 - Browse repository at this point
Copy the full SHA 77f9a15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96ddad1 - Browse repository at this point
Copy the full SHA 96ddad1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a275db - Browse repository at this point
Copy the full SHA 0a275dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for a0edde8 - Browse repository at this point
Copy the full SHA a0edde8View commit details
Commits on May 25, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 3ae86f0 - Browse repository at this point
Copy the full SHA 3ae86f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83a8b57 - Browse repository at this point
Copy the full SHA 83a8b57View commit details -
Configuration menu - View commit details
-
Copy full SHA for e74dc1f - Browse repository at this point
Copy the full SHA e74dc1fView commit details
Commits on May 31, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 3c07935 - Browse repository at this point
Copy the full SHA 3c07935View commit details -
Configuration menu - View commit details
-
Copy full SHA for c70b98b - Browse repository at this point
Copy the full SHA c70b98bView commit details
Commits on Jun 1, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 66d2c4d - Browse repository at this point
Copy the full SHA 66d2c4dView commit details
Commits on Jun 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7e7c85e - Browse repository at this point
Copy the full SHA 7e7c85eView commit details
Commits on Jun 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ff8cb07 - Browse repository at this point
Copy the full SHA ff8cb07View commit details
Commits on Nov 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ebf8f9c - Browse repository at this point
Copy the full SHA ebf8f9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 675cdca - Browse repository at this point
Copy the full SHA 675cdcaView commit details
Commits on Nov 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d2648e1 - Browse repository at this point
Copy the full SHA d2648e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for e23485b - Browse repository at this point
Copy the full SHA e23485bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef3082c - Browse repository at this point
Copy the full SHA ef3082cView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea2d275 - Browse repository at this point
Copy the full SHA ea2d275View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8219fa - Browse repository at this point
Copy the full SHA b8219faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92ca951 - Browse repository at this point
Copy the full SHA 92ca951View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2aa3fe0 - Browse repository at this point
Copy the full SHA 2aa3fe0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e28d7ac - Browse repository at this point
Copy the full SHA e28d7acView commit details
Commits on Jan 6, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e477f50 - Browse repository at this point
Copy the full SHA e477f50View commit details -
Configuration menu - View commit details
-
Copy full SHA for e945015 - Browse repository at this point
Copy the full SHA e945015View commit details -
Configuration menu - View commit details
-
Copy full SHA for c8cddc4 - Browse repository at this point
Copy the full SHA c8cddc4View commit details
Commits on Jan 7, 2023
-
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 3388b4a - Browse repository at this point
Copy the full SHA 3388b4aView commit details
Commits on Jan 11, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 79c65da - Browse repository at this point
Copy the full SHA 79c65daView commit details
Commits on Jan 21, 2023
-
Added missing details to SystemParam Local documentation. (bevyengine…
…#7106) # Objective `SystemParam` `Local`s documentation currently leaves out information that should be documented. - What happens when multiple `SystemParam`s within the same system have the same `Local` type. - What lifetime parameter is expected by `Local`. ## Solution - Added sentences to documentation to communicate this information. - Renamed `Local` lifetimes in code to `'s` where they previously were not. Users can get complicated incorrect suggested fixes if they pass the wrong lifetime. Some instance of the code had `'w` indicating the expected lifetime might not have been known to those that wrote the code either. Co-authored-by: iiYese <83026177+iiYese@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 83b03f8 - Browse repository at this point
Copy the full SHA 83b03f8View commit details -
Fix doc comment "Turbo" -> "Extreme" (bevyengine#7091)
# Objective Doc comment mentions turbo which is a sensitivity that doesn't exist. ## Solution Change the comment to "Extreme" which does exist
Configuration menu - View commit details
-
Copy full SHA for b0b7e58 - Browse repository at this point
Copy the full SHA b0b7e58View commit details -
add
Axis::devices
to get all the input devices (bevyengine#5400)(github made me type out a message for the commit which looked like it was for the pr, sorry) # Objective - Add a way to get all of the input devices of an `Axis`, primarily useful for looping through them ## Solution - Adds `Axis<T>::devices()` which returns a `FixedSizeIterator<Item = &T>` - Adds a (probably unneeded) `test_axis_devices` test because tests are cool. --- ## Changelog - Added `Axis<T>::devices()` method ## Migration Guide Not a breaking change.
Configuration menu - View commit details
-
Copy full SHA for bebfb01 - Browse repository at this point
Copy the full SHA bebfb01View commit details -
Update an outdated example for
Mut::map_unchanged
(bevyengine#7115)# Objective - The doctest for `Mut::map_unchanged` uses a fake function `set_if_not_equal` to demonstrate usage. - Now that bevyengine#6853 has been merged, we can use `Mut::set_if_neq` directly instead of mocking it.
Configuration menu - View commit details
-
Copy full SHA for 5fa57ab - Browse repository at this point
Copy the full SHA 5fa57abView commit details -
Remove the
SystemParamState
trait and remove types likeResState
(b……evyengine#6919) Spiritual successor to bevyengine#5205. Actual successor to bevyengine#6865. # Objective Currently, system params are defined using three traits: `SystemParam`, `ReadOnlySystemParam`, `SystemParamState`. The behavior for each param is specified by the `SystemParamState` trait, while `SystemParam` simply defers to the state. Splitting the traits in this way makes it easier to implement within macros, but it increases the cognitive load. Worst of all, this approach requires each `MySystemParam` to have a public `MySystemParamState` type associated with it. ## Solution * Merge the trait `SystemParamState` into `SystemParam`. * Remove all trivial `SystemParam` state types. * `OptionNonSendMutState<T>`: you will not be missed. --- - [x] Fix/resolve the remaining test failure. ## Changelog * Removed the trait `SystemParamState`, merging its functionality into `SystemParam`. ## Migration Guide **Note**: this should replace the migration guide for bevyengine#6865. This is relative to Bevy 0.9, not main. The traits `SystemParamState` and `SystemParamFetch` have been removed, and their functionality has been transferred to `SystemParam`. ```rust // Before (0.9) impl SystemParam for MyParam<'_, '_> { type State = MyParamState; } unsafe impl SystemParamState for MyParamState { fn init(world: &mut World, system_meta: &mut SystemMeta) -> Self { ... } } unsafe impl<'w, 's> SystemParamFetch<'w, 's> for MyParamState { type Item = MyParam<'w, 's>; fn get_param(&mut self, ...) -> Self::Item; } unsafe impl ReadOnlySystemParamFetch for MyParamState { } // After (0.10) unsafe impl SystemParam for MyParam<'_, '_> { type State = MyParamState; type Item<'w, 's> = MyParam<'w, 's>; fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State { ... } fn get_param<'w, 's>(state: &mut Self::State, ...) -> Self::Item<'w, 's>; } unsafe impl ReadOnlySystemParam for MyParam<'_, '_> { } ``` The trait `ReadOnlySystemParamFetch` has been replaced with `ReadOnlySystemParam`. ```rust // Before unsafe impl ReadOnlySystemParamFetch for MyParamState {} // After unsafe impl ReadOnlySystemParam for MyParam<'_, '_> {} ```
Configuration menu - View commit details
-
Copy full SHA for 563cb2e - Browse repository at this point
Copy the full SHA 563cb2eView commit details -
bevy_render: Run calculate_bounds in the end-of-update exclusive syst…
…ems (bevyengine#7127) # Objective - Avoid slower than necessary first frame after spawning many entities due to them not having `Aabb`s and so being marked visible - Avoids unnecessarily large system and VRAM allocations as a consequence ## Solution - I noticed when debugging the `many_cubes` stress test in Xcode that the `MeshUniform` binding was much larger than it needed to be. I realised that this was because initially, all mesh entities are marked as being visible because they don't have `Aabb`s because `calculate_bounds` is being run in `PostUpdate` and there are no system commands applications before executing the visibility check systems that need the `Aabb`s. The solution then is to run the `calculate_bounds` system just before the previous system commands are applied which is at the end of the `Update` stage.
Configuration menu - View commit details
-
Copy full SHA for 8340a3b - Browse repository at this point
Copy the full SHA 8340a3bView commit details -
Support storage buffers in derive
AsBindGroup
(bevyengine#6129)# Objective - Storage buffers are useful and not currently supported by the `AsBindGroup` derive which means you need to expand the macro if you need a storage buffer ## Solution - Add a new `#[storage]` attribute to the derive `AsBindGroup` macro. - Support and optional `read_only` parameter that defaults to false when not present. - Support visibility parameters like the texture and sampler attributes. --- ## Changelog - Add a new `#[storage(index)]` attribute to the derive `AsBindGroup` macro. Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 025010a - Browse repository at this point
Copy the full SHA 025010aView commit details -
Expose symphonia features from rodio in bevy_audio and bevy (bevyengi…
…ne#6388) # Objective Fix bevyengine#6301 ## Solution Add new features in `bevy_audio` to use `symphonia` sound format from `rodio` Also add in `bevy`
Configuration menu - View commit details
-
Copy full SHA for a15827b - Browse repository at this point
Copy the full SHA a15827bView commit details -
Smooth Transition between Animations (bevyengine#6922)
# Objective - Fixes bevyengine#6338 This PR allows for smooth transitions between different animations. ## Solution - This PR uses very simple linear blending of animations. - When starting a new animation, you can give it a duration, and throughout that duration, the previous and the new animation are being linearly blended, until only the new animation is running. - I'm aware of bevyengine/rfcs#49 and bevyengine/rfcs#51, which are more complete solutions to this problem, but they seem still far from being implemented. Until they're ready, this PR allows for the most basic use case of blending, i.e. smoothly transitioning between different animations. ## Migration Guide - no bc breaking changes
Configuration menu - View commit details
-
Copy full SHA for 49e76e6 - Browse repository at this point
Copy the full SHA 49e76e6View commit details -
Gamepad events refactor (bevyengine#6965)
# Objective - Remove redundant gamepad events - Simplify consuming gamepad events. - Refactor: Separate handling of gamepad events into multiple systems. ## Solution - Removed `GamepadEventRaw`, and `GamepadEventType`. - Added bespoke `GamepadConnectionEvent`, `GamepadAxisChangedEvent`, and `GamepadButtonChangedEvent`. - Refactored `gamepad_event_system`. - Added `gamepad_button_event_system`, `gamepad_axis_event_system`, and `gamepad_connection_system`, which update the `Input` and `Axis` resources using their corresponding event type. Gamepad events are now handled in their own systems and have their own types. This allows for querying for gamepad events without having to match on `GamepadEventType` and makes creating handlers for specific gamepad event types, like a `GamepadConnectionEvent` or `GamepadButtonChangedEvent` possible. We remove `GamepadEventRaw` by filtering the gamepad events, using `GamepadSettings`, _at the source_, in `bevy_gilrs`. This way we can create `GamepadEvent`s directly and avoid creating `GamepadEventRaw` which do not pass the user defined filters. We expose ordered `GamepadEvent`s and we can respond to individual gamepad event types. ## Migration Guide - Replace `GamepadEvent` and `GamepadEventRaw` types with their specific gamepad event type.
Configuration menu - View commit details
-
Copy full SHA for 32dac8a - Browse repository at this point
Copy the full SHA 32dac8aView commit details -
Separate Extract from Sub App Schedule (bevyengine#7046)
# Objective - This pulls out some of the changes to Plugin setup and sub apps from bevyengine#6503 to make that PR easier to review. - Separate the extract stage from running the sub app's schedule to allow for them to be run on separate threads in the future - Fixes bevyengine#6990 ## Solution - add a run method to `SubApp` that runs the schedule - change the name of `sub_app_runner` to extract to make it clear that this function is only for extracting data between the main app and the sub app - remove the extract stage from the sub app schedule so it can be run separately. This is done by adding a `setup` method to the `Plugin` trait that runs after all plugin build methods run. This is required to allow the extract stage to be removed from the schedule after all the plugins have added their systems to the stage. We will also need the setup method for pipelined rendering to setup the render thread. See https://github.com/bevyengine/bevy/blob/e3267965e15f14be18eec942dcaf16807144eb05/crates/bevy_render/src/pipelined_rendering.rs#L57-L98 ## Changelog - Separate SubApp Extract stage from running the sub app schedule. ## Migration Guide ### SubApp `runner` has conceptually been changed to an `extract` function. The `runner` no longer is in charge of running the sub app schedule. It's only concern is now moving data between the main world and the sub app. The `sub_app.app.schedule` is now run for you after the provided function is called. ```rust // before fn main() { let sub_app = App::empty(); sub_app.add_stage(MyStage, SystemStage::parallel()); App::new().add_sub_app(MySubApp, sub_app, move |main_world, sub_app| { extract(app_world, render_app); render_app.app.schedule.run(); }); } // after fn main() { let sub_app = App::empty(); sub_app.add_stage(MyStage, SystemStage::parallel()); App::new().add_sub_app(MySubApp, sub_app, move |main_world, sub_app| { extract(app_world, render_app); // schedule is automatically called for you after extract is run }); } ```
Configuration menu - View commit details
-
Copy full SHA for 45ee432 - Browse repository at this point
Copy the full SHA 45ee432View commit details -
Reduce branching in TrackedRenderPass (bevyengine#7053)
# Objective Speed up the render phase for rendering. ## Solution - Follow up bevyengine#6988 and make the internals of atomic IDs `NonZeroU32`. This niches the `Option`s of the IDs in draw state, which reduces the size and branching behavior when evaluating for equality. - Require `&RenderDevice` to get the device's `Limits` when initializing a `TrackedRenderPass` to preallocate the bind groups and vertex buffer state in `DrawState`, this removes the branch on needing to resize those `Vec`s. ## Performance This produces a similar speed up akin to that of bevyengine#6885. This shows an approximate 6% speed up in `main_opaque_pass_3d` on `many_foxes` (408.79 us -> 388us). This should be orthogonal to the gains seen there. ![image](https://user-images.githubusercontent.com/3137680/209906239-e430f026-63c2-4b95-957e-a2045b810d79.png) --- ## Changelog Added: `RenderContext::begin_tracked_render_pass`. Changed: `TrackedRenderPass` now requires a `&RenderDevice` on construction. Removed: `bevy_render::render_phase::DrawState`. It was not usable in any form outside of `bevy_render`. ## Migration Guide TODO
Configuration menu - View commit details
-
Copy full SHA for d823da0 - Browse repository at this point
Copy the full SHA d823da0View commit details -
reflect: add
insert
andremove
methods toList
(bevyengine#7063)# Objective - Fixes bevyengine#7061 ## Solution - Add and implement `insert` and `remove` methods for `List`. --- ## Changelog - Added `insert` and `remove` methods to `List`. - Changed the `push` and `pop` methods on `List` to have default implementations. ## Migration Guide - Manual implementors of `List` need to implement the new methods `insert` and `remove` and consider whether to use the new default implementation of `push` and `pop`. Co-authored-by: radiish <thesethskigamer@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4343f2e - Browse repository at this point
Copy the full SHA 4343f2eView commit details -
Panic on dropping NonSend in non-origin thread. (bevyengine#6534)
# Objective Fixes bevyengine#3310. Fixes bevyengine#6282. Fixes bevyengine#6278. Fixes bevyengine#3666. ## Solution Split out `!Send` resources into `NonSendResources`. Add a `origin_thread_id` to all `!Send` Resources, check it on dropping `NonSendResourceData`, if there's a mismatch, panic. Moved all of the checks that `MainThreadValidator` would do into `NonSendResources` instead. All `!Send` resources now individually track which thread they were inserted from. This is validated against for every access, mutation, and drop that could be done against the value. A regression test using an altered version of the example from bevyengine#3310 has been added. This is a stopgap solution for the current status quo. A full solution may involve fully removing `!Send` resources/components from `World`, which will likely require a much more thorough design on how to handle the existing in-engine and ecosystem use cases. This PR also introduces another breaking change: ```rust use bevy_ecs::prelude::*; #[derive(Resource)] struct Resource(u32); fn main() { let mut world = World::new(); world.insert_resource(Resource(1)); world.insert_non_send_resource(Resource(2)); let res = world.get_resource_mut::<Resource>().unwrap(); assert_eq!(res.0, 2); } ``` This code will run correctly on 0.9.1 but not with this PR, since NonSend resources and normal resources have become actual distinct concepts storage wise. ## Changelog Changed: Fix soundness bug with `World: Send`. Dropping a `World` that contains a `!Send` resource on the wrong thread will now panic. ## Migration Guide Normal resources and `NonSend` resources no longer share the same backing storage. If `R: Resource`, then `NonSend<R>` and `Res<R>` will return different instances from each other. If you are using both `Res<T>` and `NonSend<T>` (or their mutable variants), to fetch the same resources, it's strongly advised to use `Res<T>`.
Configuration menu - View commit details
-
Copy full SHA for 845b956 - Browse repository at this point
Copy the full SHA 845b956View commit details -
Relax
Sync
bound onLocal<T> as ExclusiveSystemParam
(bevyengine#……7040) # Objective The type `Local<T>` unnecessarily has the bound `T: Sync` when the local is used in an exclusive system. ## Solution Lift the bound. --- ## Changelog Removed the bound `T: Sync` from `Local<T>` when used as an `ExclusiveSystemParam`.
Configuration menu - View commit details
-
Copy full SHA for a151fbf - Browse repository at this point
Copy the full SHA a151fbfView commit details -
add rust-version for MSRV and CI job to check (bevyengine#6852)
# Objective - Fixes bevyengine#6777, fixes bevyengine#2998, replaces bevyengine#5518 - Help avoid confusing error message when using an older version of Rust ## Solution - Add the `rust-version` field to `Cargo.toml` - Add a CI job checking the MSRV - Add the job to bors
Configuration menu - View commit details
-
Copy full SHA for 1ad542a - Browse repository at this point
Copy the full SHA 1ad542aView commit details -
Implement
SparseSetIndex
forWorldId
(bevyengine#7125)# Objective - Fixes bevyengine#7124 ## Solution - Add Hash Derive on `WorldId` - Add `SparseSetIndex` impl
Configuration menu - View commit details
-
Copy full SHA for dc857c0 - Browse repository at this point
Copy the full SHA dc857c0View commit details -
Fix doc in
App::add_sub_app
(bevyengine#7139)# Objective - Fix the name of function parameter name in docs ## Solution - Change `f` to `sub_app_runner` --- It confused me a bit when I was reading the docs in the autocomplete hint. Hesitated about filing a PR since it's just a one single word change in the comment. Is this the right process to change these docs?
Configuration menu - View commit details
-
Copy full SHA for 6c4acf9 - Browse repository at this point
Copy the full SHA 6c4acf9View commit details -
Fix overflow scaling for images (bevyengine#7142)
# Objective - Fixes bevyengine#4057 - Do not multiply position by scale factor
Configuration menu - View commit details
-
Copy full SHA for 1246fdf - Browse repository at this point
Copy the full SHA 1246fdfView commit details -
Add
TypeRegistrationDeserializer
and removeBorrowedStr
(bevyengi……ne#7094) # Objective This a follow-up to bevyengine#6894, see bevyengine#6894 (comment) The goal is to avoid cloning any string when getting a `&TypeRegistration` corresponding to a string which is being deserialized. As a bonus code duplication is also reduced. ## Solution The manual deserialization of a string and lookup into the type registry has been moved into a separate `TypeRegistrationDeserializer` type, which implements `DeserializeSeed` with a `Visitor` that accepts any string with `visit_str`, even ones that may not live longer than that function call. `BorrowedStr` has been removed since it's no longer used. --- ## Changelog - The type `TypeRegistrationDeserializer` has been added, which simplifies getting a `&TypeRegistration` while deserializing a string.
Configuration menu - View commit details
-
Copy full SHA for 5cda426 - Browse repository at this point
Copy the full SHA 5cda426View commit details -
Add
Mut::reborrow
(bevyengine#7114)# Objective - In some cases, you need a `Mut<T>` pointer, but you only have a mutable reference to one. There is no easy way of converting `&'a mut Mut<'_, T>` -> `Mut<'a, T>` outside of the engine. ### Example (Before) ```rust fn do_with_mut<T>(val: Mut<T>) { ... } for x: Mut<T> in &mut query { // The function expects a `Mut<T>`, so `x` gets moved here. do_with_mut(x); // Error: use of moved value. do_a_thing(&x); } ``` ## Solution - Add the function `reborrow`, which performs the mapping. This is analogous to `PtrMut::reborrow`. ### Example (After) ```rust fn do_with_mut<T>(val: Mut<T>) { ... } for x: Mut<T> in &mut query { // We reborrow `x`, so the original does not get moved. do_with_mut(x.reborrow()); // Works fine. do_a_thing(&x); } ``` --- ## Changelog - Added the method `reborrow` to `Mut`, `ResMut`, `NonSendMut`, and `MutUntyped`.
Configuration menu - View commit details
-
Copy full SHA for b7f1421 - Browse repository at this point
Copy the full SHA b7f1421View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ae7f77 - Browse repository at this point
Copy the full SHA 0ae7f77View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1029b0b - Browse repository at this point
Copy the full SHA 1029b0bView commit details