Rename list to context tree.

This commit is contained in:
Tom Alexander 2022-11-24 15:10:13 -05:00
parent 7976e017fd
commit 1b8dada135
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 5 additions and 5 deletions

View File

@ -15,22 +15,22 @@ struct Node<'r, T> {
next: Link<'r, T>,
}
pub struct List<'r, T> {
pub struct ContextTree<'r, T> {
head: Option<Node<'r, T>>,
}
impl<'r, T> List<'r, T> {
impl<'r, T> ContextTree<'r, T> {
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 {
elem: element,
next: self.head.as_ref(),
};
List {
ContextTree {
head: Some(new_node),
}
}