refactor: no need for manually handling an issue with response content twice

This commit is contained in:
Maarten van Heusden
2024-10-29 14:24:13 +01:00
parent 7f2833c4ac
commit b9b09778ad

View File

@@ -41,10 +41,7 @@ pub async fn download_file(url: &str, filename: &Path) -> io::Result<()> {
.await
.expect("Failed to contact internet.");
let content = response
.bytes()
.await
.expect("Failed to get response content.");
let content = response.bytes().await.unwrap();
file.write_all(&content)?;
Ok(())