Trying to figure out the Rust idiomatic way of doing the following.
Given an arbitrary array of hex bytes, find the exact order in a given another arbitrary hex array. Below is what I'm trying to do but the closure with "matches!" is not recognizing the "find_this" variable passed to the function.
Obviously not understanding something. Thanks
pub fn found_hex(
value: &Vec<u8>,
find_this: &Vec<u8>
) -> std::io::Result<bool>
{
if value.windows(find_this.len()).any(|s| matches!(s, find_this)) {
Ok(true)
} else {
Ok(false)
}
}