Lines Matching defs:find
16 This example shows how to use [`find_iter`] to find occurrences of a substring
33 This example shows how to use [`rfind_iter`] to find occurrences of a substring
64 assert_eq!(Some(4), finder.find(b"baz foo quux"));
65 assert_eq!(None, finder.find(b"quux baz bar"));
254 /// assert_eq!(Some(0), memmem::find(haystack, b"foo"));
255 /// assert_eq!(Some(4), memmem::find(haystack, b"bar"));
256 /// assert_eq!(None, memmem::find(haystack, b"quux"));
259 pub fn find(haystack: &[u8], needle: &[u8]) -> Option<usize> {
261 rabinkarp::find(haystack, needle)
263 Finder::new(needle).find(haystack)
357 .find(&mut self.prestate, &self.haystack[self.pos..]);
442 /// [`find`] is good enough, but `Finder` is useful when you can meaningfully
480 /// assert_eq!(Some(0), Finder::new("foo").find(haystack));
481 /// assert_eq!(Some(4), Finder::new("bar").find(haystack));
482 /// assert_eq!(None, Finder::new("quux").find(haystack));
484 pub fn find(&self, haystack: &[u8]) -> Option<usize> {
485 self.searcher.find(&mut self.searcher.prefilter_state(), haystack)
756 /// if we can quickly find candidate starting positions for a match.
930 fn find(
960 gs.find(haystack, needle)
974 gs.find(haystack, needle)
1005 return tw.find(Some(&mut pre), haystack, needle);
1008 tw.find(None, haystack, needle)
1142 define_memmem_quickcheck_tests!(super::find, super::rfind);
1235 define_memmem_simple_tests!(super::find, super::rfind);