diff --git a/lib/utils/src/linked_list.rs b/lib/utils/src/linked_list.rs index c637d4c..93e81d4 100644 --- a/lib/utils/src/linked_list.rs +++ b/lib/utils/src/linked_list.rs @@ -65,6 +65,12 @@ impl, const ID: usize> Link { &*(container_of_offset!(self, T, T::LINK_OFFSET)) } + pub fn is_empty(&self) -> bool { + debug_assert!(!(self.prev.is_none() && self.next.is_some())); + debug_assert!(!(self.prev.is_some() && self.next.is_none())); + self.prev.is_none() && self.next.is_none() + } + pub fn prev_raw(&self) -> &Option> { &self.prev }