Skip to content

Commit

Permalink
Rename Tree::get to Tree::leaf
Browse files Browse the repository at this point in the history
  • Loading branch information
ureeves committed Jan 13, 2024
1 parent 78047b0 commit 67fdf85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ where
}

/// Returns the leaf at the given index, if any.
pub fn get(&self, index: usize) -> Option<&T> {
pub fn leaf(&self, index: usize) -> Option<&T> {
if self.is_unallocated() {
return None;
}
Expand Down Expand Up @@ -350,14 +350,14 @@ mod tests {
}

for i in index_set {
assert_eq!(tree.get(i), Some(&Count(1)));
assert_eq!(tree.leaf(i), Some(&Count(1)));
}
}

#[test]
fn get_empty() {
let tree = Tree::new();
assert_eq!(tree.get(0), None);
assert_eq!(tree.leaf(0), None);
}

#[test]
Expand Down

0 comments on commit 67fdf85

Please sign in to comment.