Skip to content

Commit

Permalink
Remove unnecessary mut (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbkaisetsu authored Jun 6, 2024
1 parent 2d7999a commit 32cca7c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A fast implementation of the Aho-Corasick algorithm using the compact double-arr
[![Crates.io](https://img.shields.io/crates/v/daachorse)](https://crates.io/crates/daachorse)
[![Documentation](https://docs.rs/daachorse/badge.svg)](https://docs.rs/daachorse)
[![Rust](https://img.shields.io/badge/rust-1.61%2B-blue.svg?maxAge=3600)](https://github.com/daac-tools/daachorse)
[![Build Status](https://github.com/daac-tools/daachorse/actions/workflows/rust.yml/badge.svg)](https://github.com/daac-tools/daachorse)
[![Build Status](https://github.com/daac-tools/daachorse/actions/workflows/rust.yml/badge.svg)](https://github.com/daac-tools/daachorse/actions)
[![Slack](https://img.shields.io/badge/join-chat-brightgreen?logo=slack)](https://join.slack.com/t/daac-tools/shared_invite/zt-1pwwqbcz4-KxL95Nam9VinpPlzUpEGyA)

The main technical ideas behind this library appear in the following paper:
Expand Down
2 changes: 1 addition & 1 deletion src/bytewise/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl DoubleArrayAhoCorasickBuilder {
})
}

fn build_sparse_nfa<I, P, V>(&mut self, patvals: I) -> Result<BytewiseNfaBuilder<V>>
fn build_sparse_nfa<I, P, V>(&self, patvals: I) -> Result<BytewiseNfaBuilder<V>>
where
I: IntoIterator<Item = (P, V)>,
P: AsRef<[u8]>,
Expand Down
4 changes: 2 additions & 2 deletions src/nfa_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ where
Ok(())
}

pub(crate) fn build_fails(&mut self) -> Vec<u32> {
pub(crate) fn build_fails(&self) -> Vec<u32> {
let mut q = Vec::with_capacity(self.states.len());
for &child_id in self.states[usize::from_u32(ROOT_STATE_ID)]
.borrow()
Expand Down Expand Up @@ -155,7 +155,7 @@ where
q
}

pub(crate) fn build_fails_leftmost(&mut self) -> Vec<u32> {
pub(crate) fn build_fails_leftmost(&self) -> Vec<u32> {
let mut q = Vec::with_capacity(self.states.len());
for &child_id in self.states[usize::from_u32(ROOT_STATE_ID)]
.borrow()
Expand Down

0 comments on commit 32cca7c

Please sign in to comment.