From 7e58d0240c3b7a0c43f6b03005af227057311452 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Tue, 5 Apr 2022 21:43:49 +0200 Subject: [PATCH] Improve lookahead documentation Given that a colleague also was not able to spot my mistake on its own I know three people which missed the this issue. It might be obvious for those with a better understanding so please feel free to reject (or reword) this proposal :) https://discord.com/channels/273534239310479360/512792629516173323/960864849305432095 --- src/lookahead.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lookahead.rs b/src/lookahead.rs index f0ed628eda..2d8365140d 100644 --- a/src/lookahead.rs +++ b/src/lookahead.rs @@ -18,6 +18,9 @@ use std::cell::RefCell; /// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek /// [`ParseStream::lookahead1`]: crate::parse::ParseBuffer::lookahead1 /// +/// Please be aware that advancing the source stream with parse() will not advance +/// the lookahead object. +/// /// # Example /// /// ``` @@ -136,7 +139,7 @@ impl<'a> Lookahead1<'a> { /// Types that can be parsed by looking at just one token. /// /// Use [`ParseStream::peek`] to peek one of these types in a parse stream -/// without consuming it from the stream. +/// without consuming it from the stream. /// /// This trait is sealed and cannot be implemented for types outside of Syn. ///