From 31d93e1bd0f11abf5d418964833a71e12c71f717 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 1 Nov 2024 20:36:04 -0700 Subject: [PATCH] Make Cursor::any_group public --- src/buffer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/buffer.rs b/src/buffer.rs index 3dd47198a..b4d198072 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -256,7 +256,9 @@ impl<'a> Cursor<'a> { None } - pub(crate) fn any_group(self) -> Option<(Cursor<'a>, Delimiter, DelimSpan, Cursor<'a>)> { + /// If the cursor is pointing at a `Group`, returns a cursor into the group + /// and one pointing to the next `TokenTree`. + pub fn any_group(self) -> Option<(Cursor<'a>, Delimiter, DelimSpan, Cursor<'a>)> { if let Entry::Group(group, end_offset) = self.entry() { let delimiter = group.delimiter(); let span = group.delim_span();