Implement the structure to the check_fail_matcher function.

This commit is contained in:
Tom Alexander
2022-12-03 22:12:13 -05:00
parent 13ee93f31c
commit 1a7bfd23f1
2 changed files with 33 additions and 2 deletions

View File

@@ -25,7 +25,17 @@ impl<T> List<T> {
}
}
pub fn without_front(&self) -> List<T> {
List {
head: self.head.as_ref().map(|node| node.parent.clone()).flatten()
}
}
pub fn get_data(&self) -> Option<&T> {
self.head.as_ref().map(|rc_node| &rc_node.data)
}
pub fn is_empty(&self) -> bool {
self.head.is_none()
}
}