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

Function strcoll

crates/stdlib/src/locale.rs:152–156  ·  view source on GitHub ↗
(string1: PyUtf8StrRef, string2: PyUtf8StrRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

150
151 #[pyfunction]
152 fn strcoll(string1: PyUtf8StrRef, string2: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult {
153 let cstr1 = CString::new(string1.as_str()).map_err(|e| e.to_pyexception(vm))?;
154 let cstr2 = CString::new(string2.as_str()).map_err(|e| e.to_pyexception(vm))?;
155 Ok(vm.new_pyobj(unsafe { libc::strcoll(cstr1.as_ptr(), cstr2.as_ptr()) }))
156 }
157
158 #[pyfunction]
159 fn strxfrm(string: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
new_pyobjMethod · 0.80
as_strMethod · 0.45
to_pyexceptionMethod · 0.45
as_ptrMethod · 0.45

Tested by

no test coverage detected