mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-14 02:13:47 +00:00
Fix the Clippy warnings in the runtime
This commit is contained in:
2 files changed
+6
-6
No files matched your search
@@ -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
|
// treats a missing count as "not counted yet" and counts that segment itself, so the
|
||||||
// document still arrives complete.
|
// document still arrives complete.
|
||||||
//
|
//
|
||||||
if let Some(tokenizer) = tokenizer {
|
if let Some(tokenizer) = tokenizer
|
||||||
if let Err(e) = segment.set_token_count(tokenizer) {
|
&& let Err(e) = segment.set_token_count(tokenizer)
|
||||||
warn!("Failed to count the tokens of a released chunk: {e}");
|
{
|
||||||
}
|
warn!("Failed to count the tokens of a released chunk: {e}");
|
||||||
}
|
}
|
||||||
|
|
||||||
chunks.push(segment);
|
chunks.push(segment);
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ fn validate_tokenizer_file(path: &PathBuf) -> Result<usize, String> {
|
|||||||
fn handle_tokenizer_store(payload: &TokenizerStorage) -> Result<String, std::io::Error> {
|
fn handle_tokenizer_store(payload: &TokenizerStorage) -> Result<String, std::io::Error> {
|
||||||
let data_dir = DATA_DIRECTORY
|
let data_dir = DATA_DIRECTORY
|
||||||
.get()
|
.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");
|
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
|
let data_dir = DATA_DIRECTORY
|
||||||
.get()
|
.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)
|
let tokenizer_path = PathBuf::from(data_dir)
|
||||||
.join("tokenizers")
|
.join("tokenizers")
|
||||||
|
|||||||
Reference in new issue
Block a user