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

Method _unicode_to_wchar_bytes

crates/stdlib/src/array.rs:808–816  ·  view source on GitHub ↗
(wtf8: &Wtf8, item_size: usize)

Source from the content-addressed store, hash-verified

806 }
807
808 fn _unicode_to_wchar_bytes(wtf8: &Wtf8, item_size: usize) -> Vec<u8> {
809 if item_size == 2 {
810 wtf8.encode_wide().flat_map(|ch| ch.to_ne_bytes()).collect()
811 } else {
812 wtf8.code_points()
813 .flat_map(|ch| ch.to_u32().to_ne_bytes())
814 .collect()
815 }
816 }
817
818 #[pymethod]
819 fn fromunicode(zelf: &Py<Self>, obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
encode_wideMethod · 0.80
code_pointsMethod · 0.80
to_u32Method · 0.45

Tested by

no test coverage detected