MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / nth

Method nth

aiscript-lexer/src/peakable.rs:40–47  ·  view source on GitHub ↗
(&mut self, n: usize)

Source from the content-addressed store, hash-verified

38
39 #[inline]
40 fn nth(&mut self, n: usize) -> Option<I::Item> {
41 match self.peeked.take() {
42 Some(None) => None,
43 Some(v @ Some(_)) if n == 0 => v,
44 Some(Some(_)) => self.iter.nth(n - 1),
45 None => self.iter.nth(n),
46 }
47 }
48
49 #[inline]
50 fn last(mut self) -> Option<I::Item> {

Callers 3

check_nextMethod · 0.80
next2Method · 0.80
parseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected