diff --git a/Cargo.lock b/Cargo.lock index c7dd21a..604f560 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -630,7 +630,6 @@ dependencies = [ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)", "rfc822_sanitizer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "rss 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/hammond-data/Cargo.toml b/hammond-data/Cargo.toml index fa8e733..286743d 100644 --- a/hammond-data/Cargo.toml +++ b/hammond-data/Cargo.toml @@ -14,7 +14,6 @@ itertools = "0.7.6" lazy_static = "1.0.0" log = "0.4.1" rayon = "0.9.0" -reqwest = "0.8.4" rfc822_sanitizer = "0.3.3" rss = "1.2.1" url = "1.6.0" diff --git a/hammond-data/src/errors.rs b/hammond-data/src/errors.rs index 34f409b..9fd441d 100644 --- a/hammond-data/src/errors.rs +++ b/hammond-data/src/errors.rs @@ -3,7 +3,6 @@ use diesel::r2d2; use diesel_migrations::RunMigrationsError; use hyper; use native_tls; -use reqwest; // use rss; use url; @@ -29,11 +28,9 @@ pub enum DataError { R2D2Error(#[cause] r2d2::Error), #[fail(display = "R2D2 Pool error: {}", _0)] R2D2PoolError(#[cause] r2d2::PoolError), - #[fail(display = "Reqwest Error: {}", _0)] - ReqError(#[cause] reqwest::Error), #[fail(display = "Hyper Error: {}", _0)] HyperError(#[cause] hyper::Error), - #[fail(display = "Url Error: {}", _0)] + #[fail(display = "Failed to parse a url: {}", _0)] UrlError(#[cause] url::ParseError), #[fail(display = "TLS Error: {}", _0)] TLSError(#[cause] native_tls::Error), @@ -62,3 +59,21 @@ impl From for DataError { DataError::R2D2PoolError(err) } } + +impl From for DataError { + fn from(err: hyper::Error) -> Self { + DataError::HyperError(err) + } +} + +impl From for DataError { + fn from(err: url::ParseError) -> Self { + DataError::UrlError(err) + } +} + +impl From for DataError { + fn from(err: native_tls::Error) -> Self { + DataError::TLSError(err) + } +} diff --git a/hammond-data/src/lib.rs b/hammond-data/src/lib.rs index 9602c5c..5fbcd49 100644 --- a/hammond-data/src/lib.rs +++ b/hammond-data/src/lib.rs @@ -46,7 +46,6 @@ extern crate itertools; extern crate native_tls; extern crate num_cpus; extern crate rayon; -extern crate reqwest; extern crate rfc822_sanitizer; extern crate rss; extern crate tokio_core;