Skip to content

Fix two clippy warnings in generated code.#1718

Open
Ytsejam76 wants to merge 2 commits intogtk-rs:mainfrom
Ytsejam76:main
Open

Fix two clippy warnings in generated code.#1718
Ytsejam76 wants to merge 2 commits intogtk-rs:mainfrom
Ytsejam76:main

Conversation

@Ytsejam76
Copy link

  1. 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.

  2. 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.

@bilelmoussaoui
Copy link
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.
@Ytsejam76
Copy link
Author

Could you share a branch showing the changes on a repo like https://github.com/gtk-rs/gtk-rs-core or gtk4-rs?

Sure, this should be it: wip/clippy_warnings_2026

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.

2 participants