We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04f4149 commit 23861a0Copy full SHA for 23861a0
src/sys/tree.rs
@@ -120,21 +120,17 @@ pub trait NodeIterator {
120
fn current_node(&mut self) -> Option<NodeId>;
121
}
122
123
-struct NodeIteratorAdapter<T>
124
-where
125
- T: NodeIterator,
126
-{
127
- ni: T,
128
-}
+#[repr(transparent)]
+struct NodeIteratorAdapter<T: NodeIterator>(T);
129
130
impl<T> Iterator for NodeIteratorAdapter<T>
131
where
132
T: NodeIterator,
133
{
134
type Item = NodeId;
135
fn next(&mut self) -> Option<Self::Item> {
136
- self.ni.next_node();
137
- self.ni.current_node()
+ self.0.next_node();
+ self.0.current_node()
138
139
140
0 commit comments