Fix return type for CollectionRef::new

gir doesn't seem to generate this correctly. I have no clue why, there
are certainly some functions where nullable=1 causes an Option return.
This commit is contained in:
Felix Krull authored and Colin Walters committed 2022-05-06 12:53:53 -04:00
1 parent 8bfefa2b14
commit 8561eaaa8c
2 files changed
+6 -2

No files matched your search

@@ -20,7 +20,8 @@ glib_wrapper! {
impl CollectionRef {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn new<'a, P: Into<Option<&'a str>>>(collection_id: P, ref_name: &str) -> CollectionRef {
// CHANGE: return type CollectionRef to Option<CollectionRef>
pub fn new<'a, P: Into<Option<&'a str>>>(collection_id: P, ref_name: &str) -> Option<CollectionRef> {
let collection_id = collection_id.into();
let collection_id = collection_id.to_glib_none();
unsafe {
@@ -60,3 +61,6 @@ impl hash::Hash for CollectionRef {
hash::Hash::hash(&self.hash(), state)
}
}
#[cfg(test)]
mod tests;