MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / contains_subslice

Function contains_subslice

atomic-cli/tests/it/git_binding_cb6a_test.rs:320–327  ·  view source on GitHub ↗
(haystack: &[u8], needle: &[u8])

Source from the content-addressed store, hash-verified

318}
319
320fn contains_subslice(haystack: &[u8], needle: &[u8]) -> bool {
321 if needle.is_empty() || haystack.len() < needle.len() {
322 return false;
323 }
324 haystack
325 .windows(needle.len())
326 .any(|window| window == needle)
327}
328
329/// The most recent change hash on the current view.
330fn latest_change_hash(repo: &atomic_repository::Repository) -> atomic_core::Hash {

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected