Skip to content

Commit d22c24f

Browse files
authored
Merge pull request #1410 from sdroege/match-info-next-end
glib: Fix `MatchInfo::next()` handling of returning `FALSE`
2 parents f769d0a + ed60bba commit d22c24f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

glib/src/match_info.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,14 @@ impl<'input> MatchInfo<'input> {
328328
}
329329

330330
#[doc(alias = "g_match_info_next")]
331-
pub fn next(&self) -> Result<(), crate::Error> {
331+
pub fn next(&self) -> Result<bool, crate::Error> {
332332
unsafe {
333333
let mut error = std::ptr::null_mut();
334334
let is_ok = ffi::g_match_info_next(self.to_glib_none().0, &mut error);
335-
debug_assert_eq!(is_ok == crate::ffi::GFALSE, !error.is_null());
336-
if error.is_null() {
337-
Ok(())
338-
} else {
335+
if !error.is_null() {
339336
Err(from_glib_full(error))
337+
} else {
338+
Ok(from_glib(is_ok))
340339
}
341340
}
342341
}

0 commit comments

Comments
 (0)