From 6db93c26dd904dd83744b2c1a2ec81a95237151a Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 27 Mar 2021 09:45:26 -0600 Subject: sorry fehler but you confuse my IDE --- Cargo.lock | 21 --------------------- Cargo.toml | 1 - src/download.rs | 6 +++--- 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 @@ -108,26 +108,6 @@ dependencies = [ "sct", ] -[[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" @@ -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>; -#[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(()) } -- cgit v1.2.3