Skip to content

Add From impls for EntityBuilder and EntityBuilderClone - #476

Merged
Ralith merged 1 commit into
Ralith:masterfrom
itsmunzir:add-from-bundle
Oct 6, 2026
Merged

Ralith merged 1 commit into
Ralith:masterfrom
itsmunzir:add-from-bundle

Conversation

@itsmunzir

Copy link
Copy Markdown

Fixes #242

EntityBuilder and EntityBuilderClone can now start from an existing bundle:

  • impl<B: DynamicBundle> From<B> for EntityBuilder
  • impl<B: DynamicBundleClone> From<B> for EntityBuilderClone

Both forward to add_bundle, so MyBundle { .. }.into() is equivalent to EntityBuilder::new() followed by add_bundle(MyBundle { .. }). This helps when a function takes a builder and the caller already holds a bundle.

Each impl carries a doc example, and unit tests spawn a tuple bundle directly and spawn twice through BuiltEntityClone.

Fixes #242. Any DynamicBundle or DynamicBundleClone can now start a builder directly, so a caller holding a bundle can hand a builder to functions that expect one.
@Ralith
Ralith merged commit e64f319 into Ralith:master Oct 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement From<DynamicBundle> and From<DynamicBundleClone> for EntityBuilder{Clone}

2 participants