| 668 | } |
| 669 | |
| 670 | pub fn rsplit<F>( |
| 671 | &self, |
| 672 | options: ByteInnerSplitOptions, |
| 673 | convert: F, |
| 674 | vm: &VirtualMachine, |
| 675 | ) -> PyResult<Vec<PyObjectRef>> |
| 676 | where |
| 677 | F: Fn(&[u8], &VirtualMachine) -> PyObjectRef, |
| 678 | { |
| 679 | let mut elements = self.elements.py_split( |
| 680 | options, |
| 681 | vm, |
| 682 | || convert(&self.elements, vm), |
| 683 | |v, s, vm| v.rsplit_str(s).map(|v| convert(v, vm)).collect(), |
| 684 | |v, s, n, vm| v.rsplitn_str(n, s).map(|v| convert(v, vm)).collect(), |
| 685 | |v, n, vm| v.py_rsplit_whitespace(n, |v| convert(v, vm)), |
| 686 | )?; |
| 687 | elements.reverse(); |
| 688 | Ok(elements) |
| 689 | } |
| 690 | |
| 691 | pub fn partition(&self, sub: &Self, vm: &VirtualMachine) -> PyResult<(Vec<u8>, bool, Vec<u8>)> { |
| 692 | self.elements.py_partition( |