(vm: &VirtualMachine, arg: PyObjectRef, data: &mut [u8])
| 661 | } |
| 662 | |
| 663 | fn pack_char(vm: &VirtualMachine, arg: PyObjectRef, data: &mut [u8]) -> PyResult<()> { |
| 664 | let v = PyBytesRef::try_from_object(vm, arg)?; |
| 665 | let ch = *v |
| 666 | .as_bytes() |
| 667 | .iter() |
| 668 | .exactly_one() |
| 669 | .map_err(|_| new_struct_error(vm, "char format requires a bytes object of length 1"))?; |
| 670 | data[0] = ch; |
| 671 | Ok(()) |
| 672 | } |
| 673 | |
| 674 | fn pack_string(vm: &VirtualMachine, arg: PyObjectRef, buf: &mut [u8]) -> PyResult<()> { |
| 675 | let b = ArgBytesLike::try_from_object(vm, arg)?; |
nothing calls this directly
no test coverage detected