MCPcopy Index your code
hub / github.com/RustPython/RustPython / rev_next

Method rev_next

crates/vm/src/builtins/iter.rs:119–130  ·  view source on GitHub ↗
(&mut self, f: F)

Source from the content-addressed store, hash-verified

117 }
118
119 pub fn rev_next<F>(&mut self, f: F) -> PyResult<PyIterReturn>
120 where
121 F: FnOnce(&T, usize) -> PyResult<PyIterReturn>,
122 {
123 self._next(f, |zelf| {
124 if zelf.position == 0 {
125 zelf.status = IterStatus::Exhausted;
126 } else {
127 zelf.position -= 1;
128 }
129 })
130 }
131
132 pub fn length_hint<F>(&self, f: F) -> usize
133 where

Callers 2

nextMethod · 0.80
nextMethod · 0.80

Calls 1

_nextMethod · 0.45

Tested by

no test coverage detected