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

Method get_find_range

crates/stdlib/src/mmap.rs:958–969  ·  view source on GitHub ↗
(&self, options: FindOptions)

Source from the content-addressed store, hash-verified

956 }
957
958 fn get_find_range(&self, options: FindOptions) -> (usize, usize) {
959 let size = self.__len__();
960 let start = options
961 .start
962 .map(|start| start.saturated_at(size))
963 .unwrap_or_else(|| self.pos());
964 let end = options
965 .end
966 .map(|end| end.saturated_at(size))
967 .unwrap_or(size);
968 (start, end)
969 }
970
971 #[pymethod]
972 fn find(&self, options: FindOptions, vm: &VirtualMachine) -> PyResult<PyInt> {

Callers 2

findMethod · 0.80
rfindMethod · 0.80

Calls 4

saturated_atMethod · 0.80
__len__Method · 0.45
mapMethod · 0.45
posMethod · 0.45

Tested by

no test coverage detected