Skip to content

Commit

Permalink
Clippy fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Dec 4, 2024
1 parent 53dd806 commit 87ed1e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yomikomi/src/strided_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<'a> StridedIndex<'a> {
}
}

impl<'a> Iterator for StridedIndex<'a> {
impl Iterator for StridedIndex<'_> {
type Item = usize;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions yomikomi/src/tokenize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::{Arc, Mutex};
use tokenizers::tokenizer::Tokenizer;

enum Processor {
Tokenizers { inner: Tokenizer, bos_id: Option<u32>, eos_id: Option<u32> },
Tokenizers { inner: Box<Tokenizer>, bos_id: Option<u32>, eos_id: Option<u32> },
SentencePiece(SentencePieceProcessor),
}

Expand Down Expand Up @@ -59,7 +59,7 @@ impl<T> Tokenize<T> {
) -> Result<Self> {
let path = path.as_ref();
let processor = if path.extension().map_or(false, |v| v == "json") {
let inner = Tokenizer::from_file(path)?;
let inner = Box::new(Tokenizer::from_file(path)?);
Processor::Tokenizers { inner, bos_id: None, eos_id: None }
} else {
Processor::SentencePiece(SentencePieceProcessor::open(path).map_err(E::wrap)?)
Expand Down

0 comments on commit 87ed1e8

Please sign in to comment.