Skip to content

Commit

Permalink
Touch up PR 1223
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 29, 2022
1 parent 296e046 commit 71260de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<'a> Cursor<'a> {
/// point at the first token after the group.
unsafe fn bump_over_group(self) -> Cursor<'a> {
match self.entry() {
&Entry::Group(_, end_offset) => Cursor::create(self.ptr.add(end_offset), self.scope),
Entry::Group(_, end_offset) => Cursor::create(self.ptr.add(*end_offset), self.scope),
_ => self.bump_ignore_group(),
}
}
Expand All @@ -196,8 +196,8 @@ impl<'a> Cursor<'a> {
/// if the cursor is not currently looking at an `Entry::Group`.
unsafe fn bump_into_group(self) -> Cursor<'a> {
match self.entry() {
&Entry::Group(_, end_offset) => {
Cursor::create(self.ptr.add(1), self.ptr.add(end_offset))
Entry::Group(_, end_offset) => {
Cursor::create(self.ptr.add(1), self.ptr.add(*end_offset))
}
_ => hint::unreachable_unchecked(),
}
Expand Down Expand Up @@ -237,7 +237,8 @@ impl<'a> Cursor<'a> {

if let Entry::Group(group, _) = self.entry() {
if group.delimiter() == delim {
let (into, over) = unsafe { (self.bump_into_group(), self.bump_over_group()) };
let into = unsafe { self.bump_into_group() };
let over = unsafe { self.bump_over_group() };
return Some((into, group.span(), over));
}
}
Expand Down

0 comments on commit 71260de

Please sign in to comment.