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

gir: Correct usage of the closure annotation #704

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

rcalixte
Copy link
Member

@rcalixte rcalixte commented Oct 6, 2024

Whenever you’re describing a function that takes a callback, you should always annotate the callback argument with the argument that contains the user data using the (closure argument) annotation

You should not annotate the data argument with a unary (closure).

The unary (closure) is meant to be used when annotating the callback type

Ref:
https://gitlab.gnome.org/GNOME/mutter/-/commit/077eb80a8d9bb2968c2bfac959c2f2ca966ca7e7

Whenever you’re describing a function that takes a callback, you
should always annotate the callback argument with the argument that
contains the user data using the (closure argument) annotation

You should not annotate the data argument with a unary (closure).

The unary (closure) is meant to be used when annotating the callback
type

Ref:
https://gitlab.gnome.org/GNOME/mutter/-/commit/077eb80a8d9bb2968c2bfac959c2f2ca966ca7e7
@mtwebster mtwebster merged commit 612cd9c into linuxmint:master Nov 3, 2024
2 checks passed
@rcalixte rcalixte deleted the gir_closure branch November 3, 2024 18:05
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.

3 participants