Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/arch/all/rabinkarp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Finder {
#[inline]
pub fn new(needle: &[u8]) -> Finder {
let mut s = Finder { hash: Hash::new(), hash_2pow: 1 };
let first_byte = match needle.get(0) {
let first_byte = match needle.first() {
None => return s,
Some(&first_byte) => first_byte,
};
Expand Down
4 changes: 2 additions & 2 deletions src/arch/all/twoway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ impl FinderRev {
let nlen = needle.len();
let mut pos = haystack.len();
let mut shift = nlen;
let first_byte = match needle.get(0) {
let first_byte = match needle.first() {
None => return Some(pos),
Some(&first_byte) => first_byte,
};
Expand Down Expand Up @@ -364,7 +364,7 @@ impl FinderRev {
) -> Option<usize> {
let nlen = needle.len();
let mut pos = haystack.len();
let first_byte = match needle.get(0) {
let first_byte = match needle.first() {
None => return Some(pos),
Some(&first_byte) => first_byte,
};
Expand Down
Loading