Generation

generate functionTue, 21 Mar 2023

Create a function that performs parallel web requests from an array of URIs using async.

fn get_web_pages(urls: Vec<&str>) -> Vec<i32> { urls.iter().map(|url| { let response = reqwest::get(url); let status = response.status(); status.as_u16() as i32 }).collect() }

Questions about programming?Chat with your personal AI assistant