Skip to content

Commit 7e58d02

Browse files
authored
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
1 parent a0f0bb3 commit 7e58d02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lookahead.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ use std::cell::RefCell;
1818
/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
1919
/// [`ParseStream::lookahead1`]: crate::parse::ParseBuffer::lookahead1
2020
///
21+
/// Please be aware that advancing the source stream with parse() will not advance
22+
/// the lookahead object.
23+
///
2124
/// # Example
2225
///
2326
/// ```
@@ -136,7 +139,7 @@ impl<'a> Lookahead1<'a> {
136139
/// Types that can be parsed by looking at just one token.
137140
///
138141
/// Use [`ParseStream::peek`] to peek one of these types in a parse stream
139-
/// without consuming it from the stream.
142+
/// without consuming it from the stream.
140143
///
141144
/// This trait is sealed and cannot be implemented for types outside of Syn.
142145
///

0 commit comments

Comments
 (0)