Skip to content

Commit

Permalink
Fill in unsafe blocks inside unsafe functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 21, 2023
1 parent 4d57a60 commit b4695ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ impl<'a> Cursor<'a> {
// past it, unless `ptr == scope`, which means that we're at the edge of
// our cursor's scope. We should only have `ptr != scope` at the exit
// from None-delimited groups entered with `ignore_none`.
while let Entry::End(_) = *ptr {
while let Entry::End(_) = unsafe { &*ptr } {
if ptr == scope {
break;
}
ptr = ptr.add(1);
ptr = unsafe { ptr.add(1) };
}

Cursor {
Expand All @@ -154,7 +154,7 @@ impl<'a> Cursor<'a> {
/// If the cursor is looking at an `Entry::Group`, the bumped cursor will
/// point at the first token in the group (with the same scope end).
unsafe fn bump_ignore_group(self) -> Cursor<'a> {
Cursor::create(self.ptr.offset(1), self.scope)
unsafe { Cursor::create(self.ptr.offset(1), self.scope) }
}

/// While the cursor is looking at a `None`-delimited group, move it to look
Expand Down

0 comments on commit b4695ff

Please sign in to comment.