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

Function handle_default

crates/stdlib/src/bisect.rs:25–29  ·  view source on GitHub ↗
(arg: OptionalArg<ArgIndex>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

23 // Handles objects that implement __index__ and makes sure index fits in needed isize.
24 #[inline]
25 fn handle_default(arg: OptionalArg<ArgIndex>, vm: &VirtualMachine) -> PyResult<Option<isize>> {
26 arg.into_option()
27 .map(|v| v.into_int_ref().try_to_primitive(vm))
28 .transpose()
29 }
30
31 // Handles defaults for lo, hi.
32 //

Callers 1

as_usizeFunction · 0.85

Calls 4

into_optionMethod · 0.80
try_to_primitiveMethod · 0.80
into_int_refMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected