diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-11-25 11:25:49 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-11-25 11:25:49 +0200 |
commit | 9fafcc343e8ef6deb317895382e15a01f9068a84 (patch) | |
tree | 0c7903670a7eb734dd8d9457df35899a296181d6 | |
parent | c21b7727530ff02fb97dc2df566135e841c9f66c (diff) | |
download | get-9fafcc343e8ef6deb317895382e15a01f9068a84.tar.gz |
rename handle to task
Sponsored-by: author
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 19b5dfe..0298c63 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use clap::Parser; async fn main() -> anyhow::Result<()> { let args = Args::parse(); let mut i = 0; - let mut handles = vec![]; + let mut tasks = vec![]; let client = reqwest::Client::builder() .danger_accept_invalid_certs(true) .build()?; @@ -12,11 +12,11 @@ async fn main() -> anyhow::Result<()> { let url = args.url.clone(); let client = client.clone(); let x = tokio::spawn(async move { client.get(&url).send().await }); - handles.push(x); + tasks.push(x); i += 1; } - println!("{} handles", handles.len()); - for h in handles { + println!("{} tasks created", tasks.len()); + for h in tasks { let result = h.await?; let response = result?; if !response.status().is_success() { |