Add a missing impl of ReadOnlySystemParam for Option<NonSend<>> (#7245)

# Objective

The trait `ReadOnlySystemParam` is not implemented for `Option<NonSend<>>`, even though it should be.

Follow-up to #7243. This fixes another mistake made in #6919.

## Solution

Add the missing impl.
This commit is contained in:
JoJoJet 2023-01-17 03:29:08 +00:00
parent 0efe66b081
commit b5893e570d

View File

@ -985,6 +985,9 @@ unsafe impl<'a, T: 'static> SystemParam for NonSend<'a, T> {
}
}
// SAFETY: Only reads a single World non-send resource
unsafe impl<T: 'static> ReadOnlySystemParam for Option<NonSend<'_, T>> {}
// SAFETY: this impl defers to `NonSend`, which initializes and validates the correct world access.
unsafe impl<T: 'static> SystemParam for Option<NonSend<'_, T>> {
type State = ComponentId;