aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock21
-rw-r--r--Cargo.toml1
-rw-r--r--src/download.rs6
3 files changed, 3 insertions, 25 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ceb88ef..ce55b33 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -109,26 +109,6 @@ dependencies = [
]
[[package]]
-name = "fehler"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5729fe49ba028cd550747b6e62cd3d841beccab5390aa398538c31a2d983635"
-dependencies = [
- "fehler-macros",
-]
-
-[[package]]
-name = "fehler-macros"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccb5acb1045ebbfa222e2c50679e392a71dd77030b78fb0189f2d9c5974400f9"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -963,7 +943,6 @@ name = "webget"
version = "0.1.0"
dependencies = [
"anyhow",
- "fehler",
"futures",
"hyper",
"hyper-rustls",
diff --git a/Cargo.toml b/Cargo.toml
index 52ad8a5..fcf5c7d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,6 @@ edition = "2018"
[dependencies]
anyhow = "1"
-fehler = "1"
futures = "0.3.13"
hyper = { version = "0.14.5", features = ["client", "http1", "runtime", "stream"] }
hyper-rustls = "0.22.1"
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(())
}