Cleaning up compiler warnings.

This commit is contained in:
Tom Alexander
2023-04-21 18:22:17 -04:00
parent f4aaa43497
commit 04dfffc000
7 changed files with 11 additions and 31 deletions

View File

@@ -64,16 +64,19 @@ impl<T> List<T> {
}
}
#[allow(dead_code)]
pub fn without_front(&self) -> List<T> {
List {
head: self.head.as_ref().map(|node| node.parent.clone()).flatten(),
}
}
#[allow(dead_code)]
pub fn get_data(&self) -> Option<&T> {
self.head.as_ref().map(|rc_node| &rc_node.data)
}
#[allow(dead_code)]
pub fn is_empty(&self) -> bool {
self.head.is_none()
}
@@ -92,6 +95,7 @@ impl<T> List<T> {
}
}
#[allow(dead_code)]
pub fn iter_until<'a>(&'a self, other: &'a List<T>) -> impl Iterator<Item = &Rc<Node<T>>> {
NodeIterUntil {
position: &self.head,
@@ -99,6 +103,7 @@ impl<T> List<T> {
}
}
#[allow(dead_code)]
pub fn into_iter_until<'a>(self, other: &'a List<T>) -> impl Iterator<Item = T> + 'a {
NodeIntoIterUntil {
position: self,