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

12660 progress and small optimization #13244

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

moonlightaria
Copy link
Contributor

Objective

small effort towards #12660 along with a small optimization found in the process
first commit

Copy link
Contributor

github-actions bot commented May 5, 2024

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

Copy link
Contributor

@killercup killercup left a comment

Choose a reason for hiding this comment

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

Nice, small PR. Some of the diff is mainly from formatting but I guess there's no way around it.

crates/bevy_animation/src/lib.rs Outdated Show resolved Hide resolved
crates/bevy_winit/src/accessibility.rs Outdated Show resolved Hide resolved
crates/bevy_winit/src/accessibility.rs Outdated Show resolved Hide resolved
crates/bevy_winit/src/winit_windows.rs Outdated Show resolved Hide resolved
crates/bevy_winit/src/winit_windows.rs Outdated Show resolved Hide resolved
@pablo-lua pablo-lua added C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-Cross-Cutting Impacts the entire engine labels May 5, 2024
@matiqo15 matiqo15 added the C-Code-Quality A section of code that is hard to understand or change label May 5, 2024
@moonlightaria moonlightaria requested a review from mockersf May 8, 2024 16:45
Copy link
Member

@mockersf mockersf left a comment

Choose a reason for hiding this comment

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

I think messages in expect should be more helpful than some of those to be useful. They should provide some more context than reading the code does:

  • as the API user, does this helps me with debugging without reading the code?
  • does it provides me info on which inputs I gave that created the panic?
  • does it informs me on why they are invalid?

Replacing unwrap by expect without providing this kind of details is not helpful, and will require people who want to improve it later to understand more context, it includes strings in the binary that takes up a small place, and provides a false sense of "we don't use unwrap"

@mockersf mockersf removed 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 May 10, 2024
let search_result = self.keyframe_timestamps.binary_search_by(|probe| {
probe
.partial_cmp(&seek_time)
.expect("provided floats can't be compared")
Copy link
Member

Choose a reason for hiding this comment

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

what are those floats? why are they compared? which is an input provided by the user when calling this function?

@janhohenheim janhohenheim added the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Cross-Cutting Impacts the entire engine C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants