From 20b85ee5c9865ef274cad2772a5329dedc6774ff Mon Sep 17 00:00:00 2001 From: Adam Fortune Date: Wed, 30 Aug 2023 22:54:04 -0500 Subject: [PATCH] Fix some panic comments when attach_ancestors is called inapropriately --- src/bfs_iterators/borrow.rs | 2 +- src/bfs_iterators/mut_borrow.rs | 2 +- src/bfs_iterators/owned.rs | 2 +- src/dfs_preorder_iterators/mut_borrow.rs | 2 +- src/dfs_preorder_iterators/owned.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bfs_iterators/borrow.rs b/src/bfs_iterators/borrow.rs index 4302c23..d81d268 100644 --- a/src/bfs_iterators/borrow.rs +++ b/src/bfs_iterators/borrow.rs @@ -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) } } diff --git a/src/bfs_iterators/mut_borrow.rs b/src/bfs_iterators/mut_borrow.rs index f25f5fc..608ad0f 100644 --- a/src/bfs_iterators/mut_borrow.rs +++ b/src/bfs_iterators/mut_borrow.rs @@ -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) } } diff --git a/src/bfs_iterators/owned.rs b/src/bfs_iterators/owned.rs index b99ff89..c856512 100644 --- a/src/bfs_iterators/owned.rs +++ b/src/bfs_iterators/owned.rs @@ -82,7 +82,7 @@ impl OwnedBFSIterator /// pub fn attach_ancestors(self) -> OwnedBFSIteratorWithAncestors { 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) } } diff --git a/src/dfs_preorder_iterators/mut_borrow.rs b/src/dfs_preorder_iterators/mut_borrow.rs index 3c750ea..c70d579 100644 --- a/src/dfs_preorder_iterators/mut_borrow.rs +++ b/src/dfs_preorder_iterators/mut_borrow.rs @@ -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) } diff --git a/src/dfs_preorder_iterators/owned.rs b/src/dfs_preorder_iterators/owned.rs index 7b2e512..c6fd5e3 100644 --- a/src/dfs_preorder_iterators/owned.rs +++ b/src/dfs_preorder_iterators/owned.rs @@ -79,7 +79,7 @@ impl OwnedDFSPreorderIterator /// pub fn attach_ancestors(self) -> OwnedDFSPreorderIteratorWithAncestors { 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) }