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

Indices::push(u32) #16014

Merged
merged 1 commit into from
Oct 20, 2024
Merged

Indices::push(u32) #16014

merged 1 commit into from
Oct 20, 2024

Conversation

stepancheg
Copy link
Contributor

Objective

Making work with Indices struct easier. Currently when building indices in some quick-and-dirty code we need to do matches and handle enum variants.

Solution

Indices::push utility which works transparently with U16 and U32 variants.

Testing

Unit test added.

@stepancheg
Copy link
Contributor Author

Also, there's silent integer overflow in this code:

(Indices::U16(i1), Indices::U16(i2)) => {
i1.extend(i2.iter().map(|i| *i + index_offset as u16));
}

This code could benefit from changes like this (but not this directly).

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use X-Uncontroversial This work is generally agreed upon S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged D-Straightforward Simple bug fixes and API improvements, docs, test and examples D-Domain-Agnostic Can be tackled by anyone with generic programming or Rust skills labels Oct 19, 2024
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Oct 20, 2024
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

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

I'm not sure if I like the auto conversion, but it's not a blocker for me.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 20, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 20, 2024
Merged via the queue into bevyengine:main with commit 0cc5345 Oct 20, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Domain-Agnostic Can be tackled by anyone with generic programming or Rust skills D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants