From 929484855d067366fcf959c3582cc8db981968f5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 1 Jan 2024 12:21:33 -0800 Subject: [PATCH] async download --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0b24b92..4971f09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use anyhow::Result as AResult; use futures::StreamExt; type AssetID=u64; +const CONCURRENT_REQUESTS:usize=8; #[derive(Parser)] #[command(author,version,about,long_about=None)] @@ -59,8 +60,6 @@ fn upload_file(_path:std::path::PathBuf,_asset_id:AssetID)->AResult<()>{ Ok(()) } -const CONCURRENT_REQUESTS:usize=8; - fn read_readable(mut readable:impl Read)->AResult>{ let mut contents=Vec::new(); readable.read_to_end(&mut contents)?; @@ -103,4 +102,4 @@ async fn download_list(asset_ids:Vec)->AResult<()>{ } }).await; Ok(()) -} \ No newline at end of file +}