fn request_url(url: &str) -> Result<reqwest::blocking::Response> {
    println!("{}", url.green().bold());
    let resp = reqwest::blocking::get(url).context(DownloadSnafu)?;
    let status = resp.status();
    if status.is_success() {
        Ok(resp)
    } else {
        Err(Error::DownloadStatus { status })
    }
}
/// Try to download a file from a URL
Try to download a file from a URL
Try to download a file from a URL
fn request_url(url: &str) -> Result<reqwest::blocking::Response> {
    println!("{}", url.green().bold());
    let resp = reqwest::blocking::get(url).context(DownloadSnafu)?;
    let status = resp.status();
    if status.is_success() {
        Ok(resp)
    } else {
        Err(Error::DownloadStatus { status })
    }
}
fn request_url ( url : & str ) -> Result < reqwest :: blocking :: Response > { println ! ( " " url green ( ) bold ( ) ) ; let resp = reqwest :: blocking :: get ( url ) . context ( DownloadSnafu ) ? ; let status = resp . status ( ) ; if status . is_success ( ) { Ok ( resp ) } else { Err ( Error :: DownloadStatus { status } ) } }
Try to download a file from a URL
Try to download a file from a URL
url
&str
url
&str