(
s: PyStrRef,
encoding: PyUtf8StrRef,
errors: OptionalArg<PyUtf8StrRef>,
vm: &VirtualMachine,
)
| 52 | |
| 53 | impl ByteInnerNewOptions { |
| 54 | fn get_value_from_string( |
| 55 | s: PyStrRef, |
| 56 | encoding: PyUtf8StrRef, |
| 57 | errors: OptionalArg<PyUtf8StrRef>, |
| 58 | vm: &VirtualMachine, |
| 59 | ) -> PyResult<PyBytesInner> { |
| 60 | let bytes = pystr::encode_string(s, Some(encoding), errors.into_option(), vm)?; |
| 61 | Ok(bytes.as_bytes().to_vec().into()) |
| 62 | } |
| 63 | |
| 64 | fn get_value_from_source(source: PyObjectRef, vm: &VirtualMachine) -> PyResult<PyBytesInner> { |
| 65 | bytes_from_object(vm, &source).map(|x| x.into()) |
nothing calls this directly
no test coverage detected