(&self, data: Vec<u8>)
| 552 | |
| 553 | #[inline] |
| 554 | pub fn new_bytes(&self, data: Vec<u8>) -> PyRef<PyBytes> { |
| 555 | if data.is_empty() { |
| 556 | self.empty_bytes.clone() |
| 557 | } else { |
| 558 | PyBytes::from(data).into_ref(self) |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | #[inline] |
| 563 | pub fn new_bytearray(&self, data: Vec<u8>) -> PyRef<PyByteArray> { |