clippy
This commit is contained in:
@@ -8,13 +8,13 @@ pub async fn spawn_download_task(url: &str, state: Arc<AppState>) {
|
|||||||
let url = url.to_string();
|
let url = url.to_string();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Err(e) = download_stream(&url, state).await {
|
if let Err(e) = download_stream(&url, state).await {
|
||||||
eprintln!("Download failed: {}", e);
|
eprintln!("Download failed: {e}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn download_stream(url: &str, state: Arc<AppState>) -> Result<(), reqwest::Error> {
|
async fn download_stream(url: &str, state: Arc<AppState>) -> Result<(), reqwest::Error> {
|
||||||
println!("Starting download from: {}", url);
|
println!("Starting download from: {url}");
|
||||||
|
|
||||||
let response = reqwest::Client::new().get(url).send().await?;
|
let response = reqwest::Client::new().get(url).send().await?;
|
||||||
let mut stream = response.bytes_stream();
|
let mut stream = response.bytes_stream();
|
||||||
@@ -33,7 +33,7 @@ async fn download_stream(url: &str, state: Arc<AppState>) -> Result<(), reqwest:
|
|||||||
}
|
}
|
||||||
|
|
||||||
state.mark_complete().await;
|
state.mark_complete().await;
|
||||||
println!("Download complete! Total: {} bytes", total_size);
|
println!("Download complete! Total: {total_size} bytes");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user