fix: remove unused imports and fix type mismatches
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -7,7 +7,6 @@ use std::io::Read;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use tokio_util::io::ReaderStream;
|
||||
|
||||
/// An asynchronous wrapper around the `ItemService` for use in async contexts like the web server.
|
||||
/// It uses `tokio::task::spawn_blocking` to run synchronous database and filesystem operations
|
||||
@@ -212,7 +211,6 @@ impl AsyncItemService {
|
||||
// Since ReaderStream requires AsyncRead, we'll create our own implementation
|
||||
use tokio_stream::StreamExt;
|
||||
use tokio_util::bytes::Bytes;
|
||||
use std::io::Error;
|
||||
|
||||
// Create a channel to stream data between the blocking thread and async runtime
|
||||
let (tx, rx) = tokio::sync::mpsc::channel(1);
|
||||
@@ -247,12 +245,12 @@ impl AsyncItemService {
|
||||
let mut bytes_sent = 0;
|
||||
Box::pin(stream.take_while(move |result| {
|
||||
if bytes_sent >= length {
|
||||
return std::future::ready(false);
|
||||
return false;
|
||||
}
|
||||
if let Ok(chunk) = result {
|
||||
bytes_sent += chunk.len() as u64;
|
||||
}
|
||||
std::future::ready(true)
|
||||
true
|
||||
}))
|
||||
} else {
|
||||
Box::pin(stream)
|
||||
|
||||
Reference in New Issue
Block a user