Skip to content

Commit

Permalink
impl Debug for Iter
Browse files Browse the repository at this point in the history
As of now, bit_set::Iter does not impl Debug, so we for it is omitted
from the Debug description.
  • Loading branch information
phimuemue committed May 21, 2022
1 parent 8701dfa commit 1fb7bc8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ pub struct Iter<'sel, 'doc: 'sel> {
inner: bit_set::Iter<'sel, u32>,
}

impl<'sel, 'doc: 'sel> std::fmt::Debug for Iter<'sel, 'doc> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Iter")
.field("selection", &self.selection)
// TODO once inner implements Debug, uncomment the following or derive(Debug) for Iter
//.field("inner", &self.inner)
.finish()
}
}

impl<'sel, 'doc> Iterator for Iter<'sel, 'doc> {
type Item = Node<'doc>;

Expand Down

0 comments on commit 1fb7bc8

Please sign in to comment.