return download state clone
This commit is contained in:
@@ -22,7 +22,7 @@ struct DownloadState {
|
||||
result: Mutex<Option<Result<DownloadData, (StatusCode, String)>>>,
|
||||
}
|
||||
|
||||
#[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 => {}
|
||||
|
||||
Reference in New Issue
Block a user