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

Function _extract_vec_bytes

crates/vm/src/stdlib/posix.rs:2659–2670  ·  view source on GitHub ↗
(
        x: OptionalArg,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

2657
2658 #[cfg(target_os = "macos")]
2659 fn _extract_vec_bytes(
2660 x: OptionalArg,
2661 vm: &VirtualMachine,
2662 ) -> PyResult<Option<Vec<crate::function::ArgBytesLike>>> {
2663 x.into_option()
2664 .map(|x| {
2665 let v: Vec<crate::function::ArgBytesLike> = x.try_to_value(vm)?;
2666 Ok(if v.is_empty() { None } else { Some(v) })
2667 })
2668 .transpose()
2669 .map(Option::flatten)
2670 }
2671
2672 #[cfg(target_os = "macos")]
2673 #[pyfunction]

Callers 1

sendfileFunction · 0.85

Calls 5

into_optionMethod · 0.80
try_to_valueMethod · 0.80
SomeClass · 0.50
mapMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected