Tweak Cursor::next_with_spacing
.
This makes it more like `CursorRef::next_with_spacing`. There is no performance effect, just a consistency improvement.
This commit is contained in:
parent
8305398d7a
commit
ad566b78f2
@ -586,12 +586,10 @@ impl Cursor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn next_with_spacing(&mut self) -> Option<TreeAndSpacing> {
|
pub fn next_with_spacing(&mut self) -> Option<TreeAndSpacing> {
|
||||||
if self.index < self.stream.len() {
|
self.stream.0.get(self.index).map(|tree| {
|
||||||
self.index += 1;
|
self.index += 1;
|
||||||
Some(self.stream.0[self.index - 1].clone())
|
tree.clone()
|
||||||
} else {
|
})
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn index(&self) -> usize {
|
pub fn index(&self) -> usize {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user