From e5a7acf1a0ced9b9d5ccfef79c46579f359fac94 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Mon, 17 Dec 2018 18:37:01 +0100 Subject: messages may depend on thread, not just query. But never on other messages --- src/message.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/message.rs b/src/message.rs index 8cc7af2..bf46a4e 100644 --- a/src/message.rs +++ b/src/message.rs @@ -35,7 +35,7 @@ impl<'o, O> Message<'o, O> where O: MessageOwner + 'o, { - pub fn from_ptr

(ptr: *mut ffi::notmuch_message_t, owner: P) -> Message<'o, O> + pub(crate) fn from_ptr

(ptr: *mut ffi::notmuch_message_t, owner: P) -> Message<'o, O> where P: Into>, { @@ -55,8 +55,11 @@ where tid.to_str().unwrap().to_string() } - pub fn replies(self: &Self) -> Messages { - >::replies(self) + pub fn replies(self: &mut Self) -> Messages<'o, O> { + Messages::<'o, O>::from_ptr( + unsafe { ffi::notmuch_message_get_replies(self.handle.ptr) }, + ScopedPhantomcow::<'o, O>::share(&mut self.marker) + ) } #[cfg(feature = "v0_26")] @@ -127,16 +130,16 @@ where ) } - fn replies<'s, S>(message: S) -> Messages<'s, Message<'o, O>> - where - S: Into>>, - { - let messageref = message.into(); - Messages::from_ptr( - unsafe { ffi::notmuch_message_get_replies(messageref.handle.ptr) }, - Supercow::phantom(messageref), - ) - } + // fn replies<'s, S>(message: S) -> Messages<'s, Message<'o, O>> + // where + // S: Into>>, + // { + // let messageref = message.into(); + // Messages::from_ptr( + // unsafe { ffi::notmuch_message_get_replies(messageref.handle.ptr) }, + // Supercow::phantom(messageref), + // ) + // } fn filenames<'s, S>(message: S) -> Filenames<'s, Message<'o, O>> where -- cgit v1.2.1