Added missing Component Bound to Res<> and ResMut<> (#1962)

Fixes #1838
This commit is contained in:
MinerSebas 2021-04-19 21:53:34 +00:00
parent f1ddd7a2ad
commit e29a899b90

View File

@ -167,7 +167,7 @@ impl_query_set!();
/// Panics when used as a [`SystemParameter`](SystemParam) if the resource does not exist.
///
/// Use `Option<Res<T>>` instead if the resource might not always exist.
pub struct Res<'w, T> {
pub struct Res<'w, T: Component> {
value: &'w T,
ticks: &'w ComponentTicks,
last_change_tick: u32,
@ -311,7 +311,7 @@ impl<'a, T: Component> SystemParamFetch<'a> for OptionResState<T> {
/// Panics when used as a [`SystemParameter`](SystemParam) if the resource does not exist.
///
/// Use `Option<ResMut<T>>` instead if the resource might not always exist.
pub struct ResMut<'w, T> {
pub struct ResMut<'w, T: Component> {
value: &'w mut T,
ticks: &'w mut ComponentTicks,
last_change_tick: u32,