MCPcopy Index your code
hub / github.com/RustPython/RustPython / starts_with_bytes

Function starts_with_bytes

crates/stdlib/src/json.rs:38–40  ·  view source on GitHub ↗
(bytes: &[u8], pattern: &[u8])

Source from the content-addressed store, hash-verified

36 /// Check if a byte slice starts with a given ASCII pattern.
37 #[inline]
38 fn starts_with_bytes(bytes: &[u8], pattern: &[u8]) -> bool {
39 bytes.len() >= pattern.len() && &bytes[..pattern.len()] == pattern
40 }
41
42 #[pyattr(name = "make_scanner")]
43 #[pyclass(name = "Scanner", traverse)]

Callers 1

call_scan_onceMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected