From e8ef06c2cbb3b7613c2cccc116f6deea9198d2b5 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 11 Jan 2024 21:29:06 -0800 Subject: [PATCH] tokio looks like this on some random dude's webpage --- src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1317aef..1772e18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -164,7 +164,7 @@ fn maybe_gzip_decode(input:R)->AResult>{ async fn upload_list(cookie:String,group:Option,asset_id_file_map:AssetIDFileMap)->AResult<()>{ let client=reqwest::Client::new(); - futures::stream::iter(asset_id_file_map) + futures::stream::iter(asset_id_file_map.into_iter() .map(|(asset_id,file)|{ let client=&client; let cookie=cookie.as_str(); @@ -202,7 +202,7 @@ async fn upload_list(cookie:String,group:Option,asset_id_file_map:AssetIDFi Ok((asset_id,resp.bytes().await?)) } - }) + })) .buffer_unordered(CONCURRENT_REQUESTS) .for_each(|b:AResult<_>|async{ match b{ @@ -223,7 +223,7 @@ fn read_readable(mut readable:impl Read)->AResult>{ async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult<()>{ let client=reqwest::Client::new(); - futures::stream::iter(asset_id_file_map) + futures::stream::iter(asset_id_file_map.into_iter() .map(|(asset_id,file)|{ let client=&client; let cookie=cookie.as_str(); @@ -233,7 +233,7 @@ async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult< .send().await?; Ok((file,resp.bytes().await?)) } - }) + })) .buffer_unordered(CONCURRENT_REQUESTS) .for_each(|b:AResult<_>|async{ match b{ @@ -814,7 +814,7 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{ let repo=git2::Repository::init(config.output_folder.clone())?; //decompile all versions - futures::stream::iter(asset_list) + futures::stream::iter(asset_list.into_iter() .map(|asset_version|{ let mut file_path=config.input_folder.clone(); tokio::task::spawn(async move{ @@ -823,7 +823,7 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{ let contents=generate_decompiled_context(file)?; Ok::<_,anyhow::Error>((asset_version,contents)) }) - }) + })) .buffered(CONCURRENT_DECODE) .for_each(|join_handle_result|async{ match write_commit(WriteCommitConfig{ @@ -862,7 +862,7 @@ async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHist //download all versions let asset_id_string=config.asset_id.to_string(); - futures::stream::iter(asset_list) + futures::stream::iter(asset_list.into_iter() .map(|asset_version|{ let client=client.clone(); let cookie=config.cookie.clone(); @@ -875,7 +875,7 @@ async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHist }; Ok::<_,anyhow::Error>((asset_version,contents)) }) - }) + })) .buffered(CONCURRENT_DECODE) .for_each(|join_handle_result|async{ match write_commit(WriteCommitConfig{