(
&self,
options: anystr::StartsEndsWithArgs,
vm: &VirtualMachine,
)
| 382 | |
| 383 | #[pymethod] |
| 384 | fn startswith( |
| 385 | &self, |
| 386 | options: anystr::StartsEndsWithArgs, |
| 387 | vm: &VirtualMachine, |
| 388 | ) -> PyResult<bool> { |
| 389 | let borrowed = self.borrow_buf(); |
| 390 | let (affix, substr) = |
| 391 | match options.prepare(&*borrowed, borrowed.len(), |s, r| s.get_bytes(r)) { |
| 392 | Some(x) => x, |
| 393 | None => return Ok(false), |
| 394 | }; |
| 395 | substr.py_starts_ends_with( |
| 396 | &affix, |
| 397 | "startswith", |
| 398 | "bytes", |
| 399 | |s, x: PyBytesInner| s.starts_with(x.as_bytes()), |
| 400 | vm, |
| 401 | ) |
| 402 | } |
| 403 | |
| 404 | #[pymethod] |
| 405 | fn find(&self, options: ByteInnerFindOptions, vm: &VirtualMachine) -> PyResult<isize> { |
nothing calls this directly
no test coverage detected