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
Use boolean instead of float to avoid nightly warning #16897
Conversation
Heads up! This PR modifies the following files:
|
@bors-servo r+ |
📌 Commit 6e42d5a has been approved by |
@bors-servo: r-
|
ports/geckolib/glue.rs
Outdated
@@ -2216,14 +2214,14 @@ fn fill_in_missing_keyframe_values(all_properties: &[TransitionProperty], | |||
return; | |||
} | |||
|
|||
let keyframe = match offset { | |||
0. => unsafe { | |||
let keyframe = if is_initial { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keeping the offset
parameter and just do if offset == 0.
here? I think boolean arguments hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilio File a follow-up to use an enum. Having a float where only two values matter is even worse, and should never have been r+'d in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I had not noticed that this didn't land yet, so maybe we should just require from Manish to do that damn enum now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilio never, never, never compare float values for equality if you can help it.
And unreachable branches are not great.
@bors-servo r=nox |
📌 Commit c3660dc has been approved by |
Use boolean instead of float to avoid nightly warning It's just nicer to match on a bool, too <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16897) <!-- Reviewable:end -->
@Manishearth Tidy still fails with the empty line. |
@bors-servo r- |
@bors-servo r- force |
This makes Homu very unhappy, and @Manishearth didn't check the box that let other people edit their PRs:
|
Letting it closed because Homu still says it's pending if it stays open. |
It's just nicer to match on a bool, too
This change is