aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-27 09:45:26 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-27 09:45:26 -0600
commit6db93c26dd904dd83744b2c1a2ec81a95237151a (patch)
tree5770bd78cab6edbb5ccf0e3ffe11447716636788 /src
parent1590133d7e8d1f2cc437b683ebeed2f84ff215f7 (diff)
downloadwebget-6db93c26dd904dd83744b2c1a2ec81a95237151a.tar.gz
webget-6db93c26dd904dd83744b2c1a2ec81a95237151a.zip
sorry fehler but you confuse my IDE
Diffstat (limited to 'src')
-rw-r--r--src/download.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/download.rs b/src/download.rs
index 80a159b..72cdaf3 100644
--- a/src/download.rs
+++ b/src/download.rs
@@ -1,7 +1,6 @@
use std::path::{Path, PathBuf};
use anyhow::{bail, Error, Context};
-use fehler::throws;
use hyper::Uri;
use hyper::body::HttpBody;
use hyper::client::{Client, HttpConnector};
@@ -14,8 +13,7 @@ use super::Args;
type HttpsClient = Client<HttpsConnector<HttpConnector>>;
-#[throws]
-pub(crate) async fn download(url: Uri, args: &Args) {
+pub(crate) async fn download(url: Uri, args: &Args) -> Result<(), Error> {
let output_file_path = if let Some(output) = &args.output_document {
Some(output.clone())
} else {
@@ -56,4 +54,6 @@ pub(crate) async fn download(url: Uri, args: &Args) {
while let Some(data) = response.body_mut().data().await {
output_file.write_all(&data?).await?;
}
+
+ Ok(())
}