Skip to content

Consider returning Result from get(_mut)::<Component>() on an entity #19763

Open
@Shatur

Description

@Shatur

What problem does this solve or what need does it fill?

Entity(Mut/World/WorldMut)::get_mut returns Option which doesn't play nicely with Result: requires writing an error message that entity x missing component y. Also get_mut variant doesn't allow to capture the entity because it's already mutably borrowed.

What solution would you like?

Return Result instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions