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 the VfsFileLookupFunc's return value so that it is nullable #219

Closed
wants to merge 1 commit into from

Conversation

fbrouille
Copy link
Contributor

According to the VfsFileLookupFunc's description, the return value can be NULL. The current definition in Gio-2.0.gir does not specify that the return value is nullable. Therefore the generated code of Vfs in gtk-rs is incorrect:

        uri_func: Option<Box_<dyn Fn(&Vfs, &str) -> File + 'static>>,
        parse_name_func: Option<Box_<dyn Fn(&Vfs, &str) -> File + 'static>>,

This pull request fixes the definition of the VfsFileLookupFunc, in order to fix the generated code:

        uri_func: Option<Box_<dyn Fn(&Vfs, &str) -> Option<File> + 'static>>,
        parse_name_func: Option<Box_<dyn Fn(&Vfs, &str) -> Option<File> + 'static>>,

Make it nullable

Signed-off-by: fbrouille <[email protected]>
@bilelmoussaoui
Copy link
Member

The fix should be submitted to GLib imho.

@sdroege
Copy link
Member

sdroege commented Dec 12, 2024

Yes this should be submitted to GLib: https://gitlab.gnome.org/GNOME/glib/-/issues/new

Once the annotation is fixed there we will get the fix here automatically.

@sdroege sdroege closed this Dec 12, 2024
@fbrouille fbrouille deleted the fix_VfsFileLookupFunc branch December 16, 2024 21:14
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