diff --git a/rust-bindings/rust/src/checksum.rs b/rust-bindings/rust/src/checksum.rs index 070e07ed..b2f48307 100644 --- a/rust-bindings/rust/src/checksum.rs +++ b/rust-bindings/rust/src/checksum.rs @@ -32,6 +32,12 @@ impl FromGlibPtrFull<*mut [u8; 32]> for Checksum { } } +impl FromGlibPtrFull<*mut [*mut u8; 32]> for Checksum { + unsafe fn from_glib_full(ptr: *mut [*mut u8; 32]) -> Self { + Checksum::new(ptr as *mut u8 as *mut [u8; 32]) + } +} + impl FromGlibPtrFull<*mut u8> for Checksum { unsafe fn from_glib_full(ptr: *mut u8) -> Self { Checksum::new(ptr as *mut [u8; 32]) diff --git a/rust-bindings/rust/src/repo.rs b/rust-bindings/rust/src/repo.rs index bfc344cd..a6b2aaff 100644 --- a/rust-bindings/rust/src/repo.rs +++ b/rust-bindings/rust/src/repo.rs @@ -129,7 +129,7 @@ impl Repo { unsafe { let mut error = ptr::null_mut(); let mut out_csum = ptr::null_mut(); - let _ = ostree_sys::fixed::ostree_repo_write_content( + let _ = ostree_sys::ostree_repo_write_content( self.to_glib_none().0, expected_checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, @@ -156,7 +156,7 @@ impl Repo { unsafe { let mut error = ptr::null_mut(); let mut out_csum = ptr::null_mut(); - let _ = ostree_sys::fixed::ostree_repo_write_metadata( + let _ = ostree_sys::ostree_repo_write_metadata( self.to_glib_none().0, objtype.to_glib(), expected_checksum.to_glib_none().0, diff --git a/rust-bindings/rust/sys/src/manual.rs b/rust-bindings/rust/sys/src/manual.rs index 375f5a40..1319576b 100644 --- a/rust-bindings/rust/sys/src/manual.rs +++ b/rust-bindings/rust/sys/src/manual.rs @@ -1,29 +1 @@ pub use libc::stat; - -pub mod fixed { - use crate::{OstreeObjectType, OstreeRepo}; - use glib::gboolean; - use libc::c_char; - - extern "C" { - pub fn ostree_repo_write_content( - self_: *mut OstreeRepo, - expected_checksum: *const c_char, - object_input: *mut gio::GInputStream, - length: u64, - out_csum: *mut *mut [u8; 32], - cancellable: *mut gio::GCancellable, - error: *mut *mut glib::GError, - ) -> gboolean; - - pub fn ostree_repo_write_metadata( - self_: *mut OstreeRepo, - objtype: OstreeObjectType, - expected_checksum: *const c_char, - object: *mut glib::GVariant, - out_csum: *mut *mut [u8; 32], - cancellable: *mut gio::GCancellable, - error: *mut *mut glib::GError, - ) -> gboolean; - } -}