You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entry::add() and Entry::remove() both currently assume the components specified exist within the Registry, when that can't actually be assumed. Rather than doing an unwrap_unchecked on the component_index at the beginning of both methods, a regular unwrap should be done to trigger a panic if the component is not part of the Registry.
In the future, hopefully we can move this check to compile-time. Ideally, we'd be able to check if a component is a part of a Registry using a const fn, but that is currently only possible in nightly Rust. Perhaps it may be worthwhile to introduce a nightly feature gate to allow const checks.
The text was updated successfully, but these errors were encountered:
Entry::add()
andEntry::remove()
both currently assume the components specified exist within theRegistry
, when that can't actually be assumed. Rather than doing anunwrap_unchecked
on thecomponent_index
at the beginning of both methods, a regularunwrap
should be done to trigger a panic if the component is not part of theRegistry
.In the future, hopefully we can move this check to compile-time. Ideally, we'd be able to check if a component is a part of a
Registry
using aconst fn
, but that is currently only possible in nightly Rust. Perhaps it may be worthwhile to introduce anightly
feature gate to allow const checks.The text was updated successfully, but these errors were encountered: