Skip to content

Commit

Permalink
Fix some panic comments when attach_ancestors is called inapropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-adult committed Aug 31, 2023
1 parent 494145e commit 20b85ee
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bfs_iterators/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<'a, Node> BorrowedBFSIterator<'a, Node>
///
pub fn attach_ancestors(self) -> BorrowedBFSIteratorWithAncestors<'a, Node> {
match self.root {
None => panic!("Attempted to attach metadata to a BFS iterator in the middle of a tree traversal. This is forbidden."),
None => panic!("Attempted to attach metadata to a BFSIterator in the middle of a tree traversal. This is forbidden."),
Some(root) => BorrowedBFSIteratorWithAncestors::new(root)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bfs_iterators/mut_borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<'a, Node> MutBorrowedBFSIterator<'a, Node>
///
pub fn attach_ancestors(self) -> MutBorrowedBFSIteratorWithAncestors<'a, Node> {
match self.root {
None => panic!("Attempted to attach metadata to a BFS iterator in the middle of a tree traversal. This is forbidden."),
None => panic!("Attempted to attach metadata to a BFSIterator in the middle of a tree traversal. This is forbidden."),
Some(root) => MutBorrowedBFSIteratorWithAncestors::new(root)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bfs_iterators/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<Node> OwnedBFSIterator<Node>
///
pub fn attach_ancestors(self) -> OwnedBFSIteratorWithAncestors<Node> {
match self.root {
None => panic!("Attempted to attach metadata to a BFS iterator in the middle of a tree traversal. This is forbidden."),
None => panic!("Attempted to attach metadata to a BFSIterator in the middle of a tree traversal. This is forbidden."),
Some(root) => OwnedBFSIteratorWithAncestors::new(root)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dfs_preorder_iterators/mut_borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<'a, Node> MutBorrowedDFSPreorderIterator<'a, Node>
///
pub fn attach_ancestors(self) -> MutBorrowedDFSPreorderIteratorWithAncestors<'a, Node> {
match self.root {
None => panic!("Attempted to attach metadata to a DFSPostOrderIterator in the middle of a tree traversal. This is forbidden."),
None => panic!("Attempted to attach metadata to a DFSPreOrderIterator in the middle of a tree traversal. This is forbidden."),
Some(root) => {
MutBorrowedDFSPreorderIteratorWithAncestors::new(root)
}
Expand Down
2 changes: 1 addition & 1 deletion src/dfs_preorder_iterators/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<Node> OwnedDFSPreorderIterator<Node>
///
pub fn attach_ancestors(self) -> OwnedDFSPreorderIteratorWithAncestors<Node> {
match self.root {
None => panic!("Attempted to attach metadata to a DFSPostOrderIterator in the middle of a tree traversal. This is forbidden."),
None => panic!("Attempted to attach metadata to a DFSPreOrderIterator in the middle of a tree traversal. This is forbidden."),
Some(root) => {
OwnedDFSPreorderIteratorWithAncestors::new(root)
}
Expand Down

0 comments on commit 20b85ee

Please sign in to comment.