From 028595548bea83508c9626835ac84409c83778ed Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Wed, 4 Mar 2020 22:29:55 +0800 Subject: Fix #3436 --- crates/ra_mbe/src/tt_iter.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/ra_mbe/src/tt_iter.rs') diff --git a/crates/ra_mbe/src/tt_iter.rs b/crates/ra_mbe/src/tt_iter.rs index 319f1ee65..100184e66 100644 --- a/crates/ra_mbe/src/tt_iter.rs +++ b/crates/ra_mbe/src/tt_iter.rs @@ -53,6 +53,10 @@ impl<'a> TtIter<'a> { _ => Err(()), } } + + pub(crate) fn peek_n(&self, n: usize) -> Option<&tt::TokenTree> { + self.inner.as_slice().get(n) + } } impl<'a> Iterator for TtIter<'a> { -- cgit v1.2.3