diff --git a/src/lib.rs b/src/lib.rs index a91ef44..d8cd79b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,7 +119,7 @@ macro_rules! def_node { #[inline] #[doc = "Get inner"] - pub fn inner(&self) -> &$type { + pub const fn inner(&self) -> &$type { &self.inner } } @@ -190,7 +190,7 @@ macro_rules! def_generic_node { #[inline] #[doc = "Get inner"] - pub fn inner(&self) -> &T { + pub const fn inner(&self) -> &T { &self.inner } } diff --git a/src/linked_list.rs b/src/linked_list.rs index a3e91b0..b963a43 100644 --- a/src/linked_list.rs +++ b/src/linked_list.rs @@ -140,7 +140,7 @@ impl List { } /// Returns whether the list is empty. - pub fn is_empty(&self) -> bool { + pub const fn is_empty(&self) -> bool { self.list.is_empty() } diff --git a/src/raw_list.rs b/src/raw_list.rs index b400f12..fc20384 100644 --- a/src/raw_list.rs +++ b/src/raw_list.rs @@ -104,7 +104,7 @@ impl RawList { Iterator::new(self.cursor_front(), self.cursor_back()) } - pub(crate) fn is_empty(&self) -> bool { + pub(crate) const fn is_empty(&self) -> bool { self.head.is_none() }