Fix two clippy warnings in generated code.#1718
Open
Ytsejam76 wants to merge 2 commits intogtk-rs:mainfrom
Open
Fix two clippy warnings in generated code.#1718Ytsejam76 wants to merge 2 commits intogtk-rs:mainfrom
Ytsejam76 wants to merge 2 commits intogtk-rs:mainfrom
Conversation
Member
|
Could you share a branch showing the changes on a repo like https://github.com/gtk-rs/gtk-rs-core or gtk4-rs? |
…impls Emit #[derive(Default)] with a #[default] attribute on the variant instead of a manual impl Default block. Falls back to the manual impl when the default variant has a version or cfg condition.
…arent type GObject constructors often return a base class rather than the concrete type, which triggers clippy::new_ret_no_self. Suppress the warning on generated new() methods when the return type differs from Self.
Author
Sure, this should be it: wip/clippy_warnings_2026 |
This file contains hidden or 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
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.
Emit
#[derive(Default)]with a#[default]attribute on the variantinstead of a manual
impl Defaultblock. Falls back to the manual implwhen the default variant has a version or
cfgcondition.GObjectconstructors often return a base class rather than the concretetype, which triggers
clippy::new_ret_no_self. Suppress the warning ongenerated
new()methods when the return type differs fromSelf.