Skip to content

Commit

Permalink
Fix clippy error (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
kampersanda authored Jan 13, 2025
1 parent 88355a5 commit c48fdac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The detailed experimental settings and other results are available on [Wiki](htt
Crawdad contains the two trie implementations:

- `crawdad::Trie` is a standard trie form that often provides the fastest queries.
- `crawdad::MpTrie` is a minimal-prefix trie form that is memory-efficient for long strings.
- `crawdad::MpTrie` is a minimal-prefix trie form that is memory-efficient for long strings.

## Slack

Expand Down
4 changes: 2 additions & 2 deletions src/mptrie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl MpTrie {

#[inline(always)]
fn tail_iter(&self, tail_pos: usize) -> TailIter {
let tail_len = usize::try_from(self.tails[tail_pos]).unwrap();
let tail_len = usize::from(self.tails[tail_pos]);
TailIter {
trie: self,
pos: tail_pos + 1,
Expand Down Expand Up @@ -417,7 +417,7 @@ impl Iterator for TailIter<'_> {
fn next(&mut self) -> Option<Self::Item> {
if self.len != 0 {
let c = utils::unpack_u32(&self.trie.tails[self.pos..], self.trie.code_size);
self.pos += usize::try_from(self.trie.code_size).unwrap();
self.pos += usize::from(self.trie.code_size);
self.len -= 1;
Some(c)
} else {
Expand Down

0 comments on commit c48fdac

Please sign in to comment.