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

Function cstr_opt_as_ptr

crates/stdlib/src/socket.rs:2668–2670  ·  view source on GitHub ↗
(x: &OptionalArg<ffi::CString>)

Source from the content-addressed store, hash-verified

2666 }
2667
2668 fn cstr_opt_as_ptr(x: &OptionalArg<ffi::CString>) -> *const libc::c_char {
2669 x.as_ref().map_or_else(core::ptr::null, |s| s.as_ptr())
2670 }
2671
2672 #[pyfunction]
2673 fn getservbyname(

Callers 2

getservbynameFunction · 0.85
getservbyportFunction · 0.85

Calls 2

as_refMethod · 0.45
as_ptrMethod · 0.45

Tested by

no test coverage detected