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

Function contains_subslice

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

Source from the content-addressed store, hash-verified

115}
116
117fn contains_subslice(haystack: &[u8], needle: &[u8]) -> bool {
118 if needle.is_empty() || haystack.len() < needle.len() {
119 return false;
120 }
121 haystack
122 .windows(needle.len())
123 .any(|window| window == needle)
124}
125
126/// Push the branch and the binding namespace to a bare remote, then clone
127/// and configure the RFC §8.6 fetch refspec on the client.

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected