(wtf8: &Wtf8, item_size: usize)
| 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<()> { |
nothing calls this directly
no test coverage detected