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] - Use consistent names for marker generics #7788

Closed
wants to merge 4 commits into from

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Feb 22, 2023

Objective

Several places in the ECS use marker generics to avoid overlapping trait implementations, but different places alternately refer to it as Params and Marker. This is potentially confusing, since it might not be clear that the same pattern is being used. Additionally, users might be misled into thinking that the Params type corresponds to the SystemParams of a system.

Solution

Rename Params to Marker.

@JoJoJet JoJoJet added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change labels Feb 22, 2023
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dramatically clearer, thank you.

@rparrett
Copy link
Contributor

At a glance from a quick search for <P>, it looks like some shorthand ones were missed in schedule/config.rs.

@JoJoJet
Copy link
Member Author

JoJoJet commented Feb 22, 2023

Alright, that should be the last one.

@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 23, 2023
# Objective

Several places in the ECS use marker generics to avoid overlapping trait implementations, but different places alternately refer to it as `Params` and `Marker`. This is potentially confusing, since it might not be clear that the same pattern is being used. Additionally, users might be misled into thinking that the `Params` type corresponds to the `SystemParam`s of a system.

## Solution

Rename `Params` to `Marker`.
@bors bors bot changed the title Use consistent names for marker generics [Merged by Bors] - Use consistent names for marker generics Feb 23, 2023
@bors bors bot closed this Feb 23, 2023
@JoJoJet JoJoJet deleted the rename-params branch February 24, 2023 12:28
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
# Objective

Several places in the ECS use marker generics to avoid overlapping trait implementations, but different places alternately refer to it as `Params` and `Marker`. This is potentially confusing, since it might not be clear that the same pattern is being used. Additionally, users might be misled into thinking that the `Params` type corresponds to the `SystemParam`s of a system.

## Solution

Rename `Params` to `Marker`.
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-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants