Fix the Clippy warnings in the runtime

This commit is contained in:
Thorsten Sommer 2026-09-06 15:03:21 +02:00
parent 2c212f75f6
commit 1bf11c0ca7
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 6 additions and 6 deletions

View File

@ -415,10 +415,10 @@ fn take_released(held: &mut VecDeque<(u64, Chunk)>, released: Vec<(u64, String)>
// treats a missing count as "not counted yet" and counts that segment itself, so the
// document still arrives complete.
//
if let Some(tokenizer) = tokenizer {
if let Err(e) = segment.set_token_count(tokenizer) {
warn!("Failed to count the tokens of a released chunk: {e}");
}
if let Some(tokenizer) = tokenizer
&& let Err(e) = segment.set_token_count(tokenizer)
{
warn!("Failed to count the tokens of a released chunk: {e}");
}
chunks.push(segment);

View File

@ -178,7 +178,7 @@ fn validate_tokenizer_file(path: &PathBuf) -> Result<usize, String> {
fn handle_tokenizer_store(payload: &TokenizerStorage) -> Result<String, std::io::Error> {
let data_dir = DATA_DIRECTORY
.get()
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::Other, "DATA_DIRECTORY not initialized"))?;
.ok_or_else(|| std::io::Error::other("DATA_DIRECTORY not initialized"))?;
let base_path = PathBuf::from(data_dir).join("tokenizers");
@ -219,7 +219,7 @@ fn handle_tokenizer_delete(payload: &TokenizerDelete) -> Result<(), std::io::Err
let data_dir = DATA_DIRECTORY
.get()
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::Other, "DATA_DIRECTORY not initialized"))?;
.ok_or_else(|| std::io::Error::other("DATA_DIRECTORY not initialized"))?;
let tokenizer_path = PathBuf::from(data_dir)
.join("tokenizers")