diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-27 10:35:42 +0200 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-03-27 10:35:42 +0200 |
| commit | 7452e9061b397c5f1876fa6a0db4d4539aeea7d8 (patch) | |
| tree | 83f4d217246d0c234d9ea1660b7526128af608b9 | |
| parent | 65c58afe84b81ee0567eb9a6f38a2d36fbcf67f6 (diff) | |
| download | mail-7452e9061b397c5f1876fa6a0db4d4539aeea7d8.tar.gz | |
fix the iterators
| -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)) |
