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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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