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> {
|
||||
if self.index < self.stream.len() {
|
||||
self.stream.0.get(self.index).map(|tree| {
|
||||
self.index += 1;
|
||||
Some(self.stream.0[self.index - 1].clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
tree.clone()
|
||||
})
|
||||
}
|
||||
|
||||
pub fn index(&self) -> usize {
|
||||
|
Loading…
x
Reference in New Issue
Block a user