MCPcopy Create free account
hub / github.com/daniel-e/rustml / next

Method next

src/sliding.rs:363–372  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

361 type Item = &'a str;
362
363 fn next(&mut self) -> Option<Self::Item> {
364 if self.pos + self.winlen - 1 >= self.s.len() {
365 return None;
366 }
367
368 self.pos += 1;
369 // not character but byte
370 // https://users.rust-lang.org/t/how-to-get-a-substring-of-a-string/1351/7
371 Some(&self.s[(self.pos - 1)..(self.pos - 1 + self.winlen)])
372 }
373}
374
375/// Creates a sliding window of fixed size over a string.

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected