(
zelf: PyRef<Self>,
chars: OptionalOption<PyStrRef>,
vm: &VirtualMachine,
)
| 876 | |
| 877 | #[pymethod] |
| 878 | fn rstrip( |
| 879 | zelf: PyRef<Self>, |
| 880 | chars: OptionalOption<PyStrRef>, |
| 881 | vm: &VirtualMachine, |
| 882 | ) -> PyRef<Self> { |
| 883 | let s = zelf.as_wtf8(); |
| 884 | let stripped = s.py_strip( |
| 885 | chars, |
| 886 | |s, chars| s.trim_end_matches(|c| chars.contains_code_point(c)), |
| 887 | |s| s.trim_end(), |
| 888 | ); |
| 889 | if s == stripped { |
| 890 | zelf |
| 891 | } else { |
| 892 | vm.ctx.new_str(stripped) |
| 893 | } |
| 894 | } |
| 895 | |
| 896 | #[pymethod] |
| 897 | fn endswith(&self, options: anystr::StartsEndsWithArgs, vm: &VirtualMachine) -> PyResult<bool> { |
nothing calls this directly
no test coverage detected