diff --git a/src/main.rs b/src/main.rs index 5e26333..94ab47d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ struct DownloadState { result: Mutex>>, } -#[derive(Debug)] +#[derive(Debug, Clone)] struct DownloadData { body: Bytes, headers: reqwest::header::HeaderMap, @@ -45,10 +45,7 @@ impl Downloader { let result = state.result.lock().await; match &*result { Some(Ok(result)) => { - return Ok(DownloadData { - body: result.body.clone(), - headers: result.headers.clone(), - }) + return Ok(result.clone()); } Some(Err(e)) => return Err(e.clone()), None => {}