forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make builder types take and return
Self
(bevyengine#10001)
# Objective Closes bevyengine#9955. Use the same interface for all "pure" builder types: taking and returning `Self` (and not `&mut Self`). ## Solution Changed `DynamicSceneBuilder`, `SceneFilter` and `TableBuilder` to take and return `Self`. ## Changelog ### Changed - `DynamicSceneBuilder` and `SceneBuilder` methods in `bevy_ecs` now take and return `Self`. ## Migration guide When using `bevy_ecs::DynamicSceneBuilder` and `bevy_ecs::SceneBuilder`, instead of binding the builder to a variable, directly use it. Methods on those types now consume `Self`, so you will need to re-bind the builder if you don't `build` it immediately. Before: ```rust let mut scene_builder = DynamicSceneBuilder::from_world(&world); let scene = scene_builder.extract_entity(a).extract_entity(b).build(); ``` After: ```rust let scene = DynamicSceneBuilder::from_world(&world) .extract_entity(a) .extract_entity(b) .build(); ```
- Loading branch information
Showing
5 changed files
with
124 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.