Cleaning up compiler warnings.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -28,6 +28,7 @@ impl<'r, 's> ContextTree<'r, 's> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn ptr_eq<'x, 'y>(&self, other: &ContextTree<'x, 'y>) -> bool {
|
||||
self.tree.ptr_eq(&other.tree)
|
||||
}
|
||||
@@ -37,29 +38,10 @@ impl<'r, 's> ContextTree<'r, 's> {
|
||||
ContextTree { tree: new_list }
|
||||
}
|
||||
|
||||
pub fn pop_front(&mut self) -> (Option<ContextElement<'r, 's>>, ContextTree<'r, 's>) {
|
||||
let (popped_element, remaining) = self.tree.pop_front();
|
||||
(popped_element, ContextTree { tree: remaining })
|
||||
}
|
||||
|
||||
pub fn iter(&self) -> impl Iterator<Item = &Rc<Node<ContextElement<'r, 's>>>> {
|
||||
self.tree.iter()
|
||||
}
|
||||
|
||||
pub fn iter_until<'x: 'r>(
|
||||
&'r self,
|
||||
other: &'x ContextTree<'x, 's>,
|
||||
) -> impl Iterator<Item = &Rc<Node<ContextElement<'r, 's>>>> {
|
||||
self.tree.iter_until(&other.tree)
|
||||
}
|
||||
|
||||
pub fn into_iter_until<'x: 'r>(
|
||||
self,
|
||||
other: &'x ContextTree<'x, 's>,
|
||||
) -> impl Iterator<Item = ContextElement<'r, 's>> {
|
||||
self.tree.into_iter_until(&other.tree)
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
pub fn check_exit_matcher(
|
||||
&'r self,
|
||||
|
||||
@@ -22,6 +22,7 @@ pub const WORD_CONSTITUENT_CHARACTERS: &str =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
/// Check if we are below a section of the given section type regardless of depth
|
||||
#[allow(dead_code)]
|
||||
pub fn in_section<'r, 's, 'x>(context: Context<'r, 's>, section_name: &'x str) -> bool {
|
||||
for thing in context.iter() {
|
||||
match thing.get_data() {
|
||||
|
||||
Reference in New Issue
Block a user