-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix some clippy warnings in components/gfx
and components/script
#32215
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mrobinson
changed the title
Fix Some Clippy Lints in components/gfx and /script
Fix Some clippy warnings in May 2, 2024
components/gfx
and components/script
mrobinson
changed the title
Fix Some clippy warnings in
Fix some clippy warnings in May 2, 2024
components/gfx
and components/script
components/gfx
and components/script
mrobinson
approved these changes
May 2, 2024
warning: redundant closure (gfx/font.rs:415:18) warning: useless conversion to the same type (gfx/font.rs:534:9) warning: the following explicit lifetimes could be elided: 'a (gfx/font.rs:619:16) error: this loop never actually loops (gfx/font_cache_thread.rs:112:9) warning: this expression creates a reference which is immediately dereferenced by the compiler (gfx/font_cache_thread.rs:229:51) warning: redundant closure (gfx/font_cache_thread.rs:551:18) 3 instances of: warning: casting integer literal to `f64` is unnecessary (gfx/platform/freetype/font_list.rs:271-273)
It reports that by standard convention, from_* methods should not take any `&self` parameter
It reports that public types with a pub fn new() -> Self should have a Default implementation since they can be constructed without arguments
…e or `self` by reference or no `self`
contains expresses the intent better and has less failure modes (such as fencepost errors or using || instead of &&)
…ns a type already marked as `#[must_use]`
auto-merge was automatically disabled
May 2, 2024 18:38
Head branch was pushed to by a user without write access
warning: this `if` statement can be collapsed (gfx/font.rs:468:130) warning: this lifetime isn't used in the impl (gfx/platform/freetype/font.rs:341:6) warning: field assignment outside of initializer for an instance created with Default::default() (compositor.rs:881:17)
mrobinson
approved these changes
May 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
./mach build -d
does not report any errors./mach test-tidy
does not report any errors