Skip to content

Commit d04ceb3

Browse files
evanjBurntSushi
authored andcommitted
doc: find_iter, rfind_iter return non-overlapping matches
The documentation for FindIter and FindRevIter already include this detail. However, it was not immediately clear to me from the documentation what find_iter and rfind_iter do about overlapping matches. This commit resolves that confusion by addiing "non-overlapping" to the description. Closes #95
1 parent 4f4b574 commit d04ceb3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/memmem/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ mod wasm;
160160
#[cfg(all(not(miri), target_arch = "x86_64", memchr_runtime_simd))]
161161
mod x86;
162162

163-
/// Returns an iterator over all occurrences of a substring in a haystack.
163+
/// Returns an iterator over all non-overlapping occurrences of a substring in
164+
/// a haystack.
164165
///
165166
/// # Complexity
166167
///
@@ -193,8 +194,8 @@ pub fn find_iter<'h, 'n, N: 'n + ?Sized + AsRef<[u8]>>(
193194
FindIter::new(haystack, Finder::new(needle))
194195
}
195196

196-
/// Returns a reverse iterator over all occurrences of a substring in a
197-
/// haystack.
197+
/// Returns a reverse iterator over all non-overlapping occurrences of a
198+
/// substring in a haystack.
198199
///
199200
/// # Complexity
200201
///

0 commit comments

Comments
 (0)