(
&self,
options: anystr::StartsEndsWithArgs,
vm: &VirtualMachine,
)
| 911 | |
| 912 | #[pymethod] |
| 913 | fn startswith( |
| 914 | &self, |
| 915 | options: anystr::StartsEndsWithArgs, |
| 916 | vm: &VirtualMachine, |
| 917 | ) -> PyResult<bool> { |
| 918 | let (affix, substr) = |
| 919 | match options.prepare(self.as_wtf8(), self.len(), |s, r| s.get_chars(r)) { |
| 920 | Some(x) => x, |
| 921 | None => return Ok(false), |
| 922 | }; |
| 923 | substr.py_starts_ends_with( |
| 924 | &affix, |
| 925 | "startswith", |
| 926 | "str", |
| 927 | |s, x: &Py<Self>| s.starts_with(x.as_wtf8()), |
| 928 | vm, |
| 929 | ) |
| 930 | } |
| 931 | |
| 932 | #[pymethod] |
| 933 | fn removeprefix(&self, pref: PyStrRef) -> Wtf8Buf { |
no test coverage detected