Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Allow Option<NonSend<T>> and Option<NonSendMut<T>> as SystemParam #2345

Closed
wants to merge 1 commit into from

Conversation

MinerSebas
Copy link
Contributor

Objective

Currently, you can add Option<Res<T> or Option<ResMut<T> as a SystemParam, if the Resource could potentially not exist, but this functionality doesn't exist for NonSend and NonSendMut

Solution

Adds implementations to use Option<NonSend<T>> and Option<NonSendMut> as SystemParams.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Jun 15, 2021
@MinerSebas
Copy link
Contributor Author

MinerSebas commented Jun 15, 2021

This does currently conflict with #2330 as it changes/moves NonSend and its Doc-Comment.

@NathanSWard NathanSWard added A-ECS Entities, components, systems, and events C-Enhancement A new feature and removed S-Needs-Triage This issue needs to be labelled labels Jun 15, 2021
@NathanSWard
Copy link
Contributor

This looks good to me!
Other than the conflicts with #2330 witch either you or I will have to fix depending on who's PR gets merged first 😛

@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jun 15, 2021
@mockersf
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jun 26, 2021
)

# Objective

Currently, you can add `Option<Res<T>` or `Option<ResMut<T>` as a SystemParam, if the Resource could potentially not exist, but this functionality doesn't exist for `NonSend` and `NonSendMut`

## Solution

Adds implementations to use `Option<NonSend<T>>` and Option<NonSendMut<T>> as SystemParams.
@bors bors bot changed the title Allow Option<NonSend<T>> and Option<NonSendMut<T>> as SystemParam [Merged by Bors] - Allow Option<NonSend<T>> and Option<NonSendMut<T>> as SystemParam Jun 26, 2021
@bors bors bot closed this Jun 26, 2021
@MinerSebas MinerSebas deleted the Option_NonSend branch June 27, 2021 18:27
ostwilkens pushed a commit to ostwilkens/bevy that referenced this pull request Jul 27, 2021
…vyengine#2345)

# Objective

Currently, you can add `Option<Res<T>` or `Option<ResMut<T>` as a SystemParam, if the Resource could potentially not exist, but this functionality doesn't exist for `NonSend` and `NonSendMut`

## Solution

Adds implementations to use `Option<NonSend<T>>` and Option<NonSendMut<T>> as SystemParams.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Enhancement A new feature S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants