Skip to content

Conversation

@cgwalters
Copy link
Member

No description provided.

We should really have a CI gate for this...
In particular we had a conflict as the previous bindings
were generated with an old version of the C APIs.
@github-actions github-actions bot added the area/rust-bindings Relates to the Rust bindings for the C library label Jul 18, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Rust bindings to a newer version of gir and fixes several Since: annotations in the C source code. The changes are mostly related to auto-generated code and documentation. I've found one potential issue where a compiler warning might be re-introduced due to a change in how a function's return value is handled.

unsafe extern "C" fn lock_async_trampoline<P: FnOnce(Result<(), glib::Error>) + 'static>(_source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer) {
let mut error = std::ptr::null_mut();
let _ = ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The ostree_sysroot_lock_finish FFI function returns a gboolean. By removing let _ =, you might be re-introducing a compiler warning about an unused result (#[warn(unused_must_use)]). While the logic is correct (it relies on the error parameter), it's generally better to explicitly ignore the return value to avoid warnings. The previous code was likely correct in this regard.

Suggested change
ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
let _ = ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);

Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cgwalters cgwalters merged commit 66123fc into ostreedev:main Jul 20, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/rust-bindings Relates to the Rust bindings for the C library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants