From cefbccaee7882df6e5dfef7c85ef8cf76d88ad60 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 25 Aug 2020 20:57:36 +0200 Subject: [PATCH] gir: fix another out parameter --- rust-bindings/rust/gir-files/OSTree-1.0.gir | 15 ++++++++++++--- rust-bindings/rust/src/auto/sign.rs | 9 +++++---- rust-bindings/rust/src/auto/versions.txt | 2 +- rust-bindings/rust/sys/src/auto/versions.txt | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/rust-bindings/rust/gir-files/OSTree-1.0.gir b/rust-bindings/rust/gir-files/OSTree-1.0.gir index e457d524..2a84249f 100644 --- a/rust-bindings/rust/gir-files/OSTree-1.0.gir +++ b/rust-bindings/rust/gir-files/OSTree-1.0.gir @@ -13925,7 +13925,10 @@ the secret key with #ostree_sign_set_sk. line="273">the raw data to be signed with pre-loaded secret key - + in case of success will contain signature @@ -14364,7 +14367,10 @@ the secret key with #ostree_sign_set_sk. line="273">the raw data to be signed with pre-loaded secret key - + in case of success will contain signature @@ -15013,7 +15019,10 @@ Based on ostree_repo_add_gpg_signature_summary implementation. line="273">the raw data to be signed with pre-loaded secret key - + in case of success will contain signature diff --git a/rust-bindings/rust/src/auto/sign.rs b/rust-bindings/rust/src/auto/sign.rs index 3583a61f..2f715720 100644 --- a/rust-bindings/rust/src/auto/sign.rs +++ b/rust-bindings/rust/src/auto/sign.rs @@ -59,7 +59,7 @@ pub trait SignExt: 'static { fn commit_verify>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result, glib::Error>; #[cfg(any(feature = "v2020_2", feature = "dox"))] - fn data>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>; + fn data>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result; #[cfg(any(feature = "v2020_2", feature = "dox"))] fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result, glib::Error>; @@ -125,11 +125,12 @@ impl> SignExt for O { } #[cfg(any(feature = "v2020_2", feature = "dox"))] - fn data>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> { + fn data>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result { unsafe { + let mut signature = ptr::null_mut(); let mut error = ptr::null_mut(); - let _ = ostree_sys::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, signature.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + let _ = ostree_sys::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, &mut signature, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + if error.is_null() { Ok(from_glib_full(signature)) } else { Err(from_glib_full(error)) } } } diff --git a/rust-bindings/rust/src/auto/versions.txt b/rust-bindings/rust/src/auto/versions.txt index 52a580a6..79591983 100644 --- a/rust-bindings/rust/src/auto/versions.txt +++ b/rust-bindings/rust/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1) -from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+) +from gir-files (https://github.com/gtk-rs/gir-files @ ed7b959+) diff --git a/rust-bindings/rust/sys/src/auto/versions.txt b/rust-bindings/rust/sys/src/auto/versions.txt index 52a580a6..79591983 100644 --- a/rust-bindings/rust/sys/src/auto/versions.txt +++ b/rust-bindings/rust/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1) -from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+) +from gir-files (https://github.com/gtk-rs/gir-files @ ed7b959+)