I have a &[u8] slice over a binary buffer. I need to parse it, but a lot of the methods that I would like to use (such as str::find) don\'t see
&[u8]
str::find
I found the memmem crate useful for this task:
use memmem::{Searcher, TwoWaySearcher}; let search = TwoWaySearcher::new("dog".as_bytes()); assert_eq!( search.search_in("The quick brown fox jumped over the lazy dog.".as_bytes()), Some(41) );