diff options
| -rw-r--r-- | src/filenames.rs | 3 | ||||
| -rw-r--r-- | src/messages.rs | 3 | ||||
| -rw-r--r-- | src/tags.rs | 4 | ||||
| -rw-r--r-- | src/threads.rs | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/filenames.rs b/src/filenames.rs index 5d6a19c..bf65700 100644 --- a/src/filenames.rs +++ b/src/filenames.rs @@ -55,8 +55,9 @@ impl<'d> iter::Iterator for Filenames<'d> { } let ctag = unsafe { + let t = ffi::notmuch_filenames_get(self.0); ffi::notmuch_filenames_move_to_next(self.0); - CStr::from_ptr(ffi::notmuch_filenames_get(self.0)) + CStr::from_ptr(t) }; Some(PathBuf::from(ctag.to_str().unwrap())) diff --git a/src/messages.rs b/src/messages.rs index 9a539c9..16cf741 100644 --- a/src/messages.rs +++ b/src/messages.rs @@ -60,8 +60,9 @@ impl<'q, 'd> iter::Iterator for Messages<'q, 'd> { } let cmsg = unsafe { + let msg = ffi::notmuch_messages_get(self.0); ffi::notmuch_messages_move_to_next(self.0); - ffi::notmuch_messages_get(self.0) + msg }; Some(Self::Item::new(cmsg)) diff --git a/src/tags.rs b/src/tags.rs index 0ffb7ae..52fa440 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -50,8 +50,10 @@ impl<'d> iter::Iterator for Tags<'d> { } let ctag = unsafe { + let t = ffi::notmuch_tags_get(self.0); ffi::notmuch_tags_move_to_next(self.0); - CStr::from_ptr(ffi::notmuch_tags_get(self.0)) + + CStr::from_ptr(t) }; Some(ctag.to_str().unwrap().to_string()) diff --git a/src/threads.rs b/src/threads.rs index dadb137..ebfa52c 100644 --- a/src/threads.rs +++ b/src/threads.rs @@ -46,8 +46,9 @@ impl<'q, 'd> iter::Iterator for Threads<'q, 'd> { } let cthread = unsafe { + let t = ffi::notmuch_threads_get(self.0); ffi::notmuch_threads_move_to_next(self.0); - ffi::notmuch_threads_get(self.0) + t }; Some(Self::Item::new(cthread)) |
