diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-04-26 09:14:09 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-04-26 09:14:09 -0300 |
commit | 25d5d6f4e9ed901d284633691941c52c8556d17c (patch) | |
tree | c353158113eba06e67e37a77caf337a8bf1c270e /src/list.rs | |
parent | 83db3d819b7402b4f3c6ca023ddfea6204fae4b4 (diff) |
Project ValidContext to Fields<'_, '_, Contexts>
Diffstat (limited to 'src/list.rs')
-rw-r--r-- | src/list.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/list.rs b/src/list.rs index 04af87a..891fdd6 100644 --- a/src/list.rs +++ b/src/list.rs @@ -53,7 +53,7 @@ pub struct Users; /// Entries. pub struct Entries<'a, 'ph, T> { - pub(crate) context: &'a crate::ValidContext<'a, 'ph>, + pub(crate) context: &'a crate::PluginHandle<'ph>, pub(crate) list: *mut crate::internals::HexchatList, pub(crate) t: &'a T, pub(crate) valid: Rc<Cell<usize>>, @@ -61,11 +61,11 @@ pub struct Entries<'a, 'ph, T> { /// Fields. pub struct Fields<'a, 'ph, T> { - context: &'a crate::ValidContext<'a, 'ph>, - list: *mut crate::internals::HexchatList, - _t: &'a T, - id: usize, - valid: Rc<Cell<usize>>, + pub context: &'a crate::PluginHandle<'ph>, + pub list: *mut crate::internals::HexchatList, + pub _t: &'a T, + pub id: usize, + pub valid: Rc<Cell<usize>>, } // impls @@ -98,7 +98,7 @@ impl List for Users { impl<'a, 'ph, T> Drop for Entries<'a, 'ph, T> { fn drop(&mut self) { - let ph = &self.context.ph; + let ph = &self.context; self.valid.set(usize::MAX); unsafe { ph_call!(hexchat_list_free(ph, self.list)); @@ -110,7 +110,7 @@ impl<'a, 'ph, T> Iterator for Entries<'a, 'ph, T> { type Item = Fields<'a, 'ph, T>; fn next(&mut self) -> Option<Self::Item> { - let ph = &self.context.ph; + let ph = &self.context; let id = self.valid.get(); if unsafe { ph_call!(hexchat_list_next(ph, self.list)) @@ -138,7 +138,7 @@ macro_rules! field { self.id, self.valid.get(), "instances of Fields are invalidated by next()", ); - let $ph = &self.context.ph; + let $ph = &self.context; const NAME: &'static CStr = unsafe { CStr::from_bytes_with_nul_unchecked( $n.as_bytes() |