Use pointer coercion instead of messing with -sys
This commit is contained in:
1 parent
d55d1b1d43
commit
4cd981d01b
3 files changed
+8
-30
No files matched your search
@@ -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])
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user