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

Fix some clippy warnings in components/gfx and components/script #32215

Merged
merged 9 commits into from
May 2, 2024

Conversation

Pi-Cla
Copy link
Contributor

@Pi-Cla Pi-Cla commented May 2, 2024


@mrobinson mrobinson changed the title Fix Some Clippy Lints in components/gfx and /script Fix Some clippy warnings in components/gfx and components/script May 2, 2024
@mrobinson mrobinson changed the title Fix Some clippy warnings in components/gfx and components/script Fix some clippy warnings in components/gfx and components/script May 2, 2024
Pi-Cla added 8 commits May 2, 2024 12:38
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
contains expresses the intent better and has less failure modes (such as fencepost errors or using || instead of &&)
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 mrobinson enabled auto-merge May 2, 2024 19:31
@mrobinson mrobinson added this pull request to the merge queue May 2, 2024
Merged via the queue into servo:main with commit 160c7c0 May 2, 2024
9 checks passed
@Pi-Cla Pi-Cla deleted the clippy branch May 11, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants