File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -891,6 +891,12 @@ manual_traits = ["FileEnumeratorExtManual"]
891891 name = " iterate"
892892 # better with rust iterators
893893 ignore = true
894+ [[object .function ]]
895+ name = " close"
896+ [object .function .return ]
897+ # Return value does not indicate success or error: despite the documentation, this function could return TRUE and an error in same time.
898+ # see https://gitlab.gnome.org/GNOME/glib/-/blob/dc6f9447cd2a01012731422afed6facff1eea81a/gio/gfileenumerator.c#L290-297
899+ use_return_for_result = true
894900
895901[[object ]]
896902name = " Gio.FileInfo"
Original file line number Diff line number Diff line change @@ -21,17 +21,16 @@ impl FileEnumerator {
2121
2222pub trait FileEnumeratorExt : IsA < FileEnumerator > + ' static {
2323 #[ doc( alias = "g_file_enumerator_close" ) ]
24- fn close ( & self , cancellable : Option < & impl IsA < Cancellable > > ) -> Result < ( ) , glib:: Error > {
24+ fn close ( & self , cancellable : Option < & impl IsA < Cancellable > > ) -> Result < bool , glib:: Error > {
2525 unsafe {
2626 let mut error = std:: ptr:: null_mut ( ) ;
27- let is_ok = ffi:: g_file_enumerator_close (
27+ let ret = ffi:: g_file_enumerator_close (
2828 self . as_ref ( ) . to_glib_none ( ) . 0 ,
2929 cancellable. map ( |p| p. as_ref ( ) ) . to_glib_none ( ) . 0 ,
3030 & mut error,
3131 ) ;
32- debug_assert_eq ! ( is_ok == glib:: ffi:: GFALSE , !error. is_null( ) ) ;
3332 if error. is_null ( ) {
34- Ok ( ( ) )
33+ Ok ( from_glib ( ret ) )
3534 } else {
3635 Err ( from_glib_full ( error) )
3736 }
You can’t perform that action at this time.
0 commit comments