Rename list to context tree.
This commit is contained in:
parent
7976e017fd
commit
1b8dada135
@ -15,22 +15,22 @@ struct Node<'r, T> {
|
|||||||
next: Link<'r, T>,
|
next: Link<'r, T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct List<'r, T> {
|
pub struct ContextTree<'r, T> {
|
||||||
head: Option<Node<'r, T>>,
|
head: Option<Node<'r, T>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'r, T> List<'r, T> {
|
impl<'r, T> ContextTree<'r, T> {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
List { head: None }
|
ContextTree { head: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_additional_node(&'r self, element: T) -> List<'r, T> {
|
pub fn with_additional_node(&'r self, element: T) -> ContextTree<'r, T> {
|
||||||
let new_node = Node {
|
let new_node = Node {
|
||||||
elem: element,
|
elem: element,
|
||||||
next: self.head.as_ref(),
|
next: self.head.as_ref(),
|
||||||
};
|
};
|
||||||
|
|
||||||
List {
|
ContextTree {
|
||||||
head: Some(new_node),
|
head: Some(new_node),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user