From 5a14e3ba0614834a81cbe7b4aa59bb742230d7dc Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Sun, 26 Feb 2017 17:53:39 -0600 Subject: [PATCH] downgrade from reqwest -> hyper 0.9, to keep compatibility with tenquestionmarks --- Cargo.toml | 8 +++++++- src/lib.rs | 2 +- src/searchers/mod.rs | 1 - src/searchers/mtg.rs | 12 ++++++------ src/searchers/yugioh.rs | 12 ++++++------ 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6dd977d..f96fa41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,5 +8,11 @@ log = "0.3.6" env_logger = "0.4.0" sqlite = "0.23.4" select = "0.3.0" -reqwest = "0.4.0" + +# 26 February 2017: Would ideally like to use up-to-date libraries here +# but this depends on openssl 0.9.7 which conflicts with the openssl 0.7.17 dependency +# used in tenquestionmarks (ultimately brought in by discord-rs which uses hyper 0.9). So, as a necessary evil, +# we need to keep to those versions as well to be compatible with tenquestionmarks. +#reqwest = "0.4.0" +hyper = "0.9.18" serde_json = "0.9" diff --git a/src/lib.rs b/src/lib.rs index 2b8faa8..e80ae5d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -extern crate reqwest; +extern crate hyper; extern crate select; extern crate serde_json; diff --git a/src/searchers/mod.rs b/src/searchers/mod.rs index 2a232d6..37c16cb 100644 --- a/src/searchers/mod.rs +++ b/src/searchers/mod.rs @@ -2,7 +2,6 @@ pub mod mtg; pub mod yugioh; use Link; -use std::any::Any; use std::collections::BTreeMap; pub trait Searcher { diff --git a/src/searchers/mtg.rs b/src/searchers/mtg.rs index 5237fd9..e91c699 100644 --- a/src/searchers/mtg.rs +++ b/src/searchers/mtg.rs @@ -1,8 +1,8 @@ use Link; use searchers::Searcher; -use reqwest; -use reqwest::Client; +use hyper; +use hyper::Client; use serde_json; use serde_json::Value; @@ -46,7 +46,7 @@ pub struct MtgSearcher { impl MtgSearcher { pub fn new () -> MtgSearcher { MtgSearcher { - client: Client::new().unwrap() + client: Client::new() } } @@ -87,14 +87,14 @@ impl Searcher for MtgSearcher { #[derive(Debug)] enum Error { - Http(reqwest::Error), + Http(hyper::error::Error), Io(std::io::Error), Json(serde_json::Error), Other(String) } -impl From for Error { - fn from (error: reqwest::Error) -> Error { +impl From for Error { + fn from (error: hyper::error::Error) -> Error { Error::Http(error) } } diff --git a/src/searchers/yugioh.rs b/src/searchers/yugioh.rs index 0bad8be..e09b208 100644 --- a/src/searchers/yugioh.rs +++ b/src/searchers/yugioh.rs @@ -1,8 +1,8 @@ use Link; use searchers::Searcher; -use reqwest; -use reqwest::Client; +use hyper; +use hyper::Client; use serde_json; use serde_json::Value; @@ -47,7 +47,7 @@ pub struct YugiohSearcher { impl YugiohSearcher { pub fn new () -> YugiohSearcher { YugiohSearcher { - client: Client::new().unwrap() + client: Client::new() } } @@ -91,14 +91,14 @@ impl Searcher for YugiohSearcher { #[derive(Debug)] enum Error { - Http(reqwest::Error), + Http(hyper::error::Error), Io(std::io::Error), Json(serde_json::Error), Other(String) } -impl From for Error { - fn from (error: reqwest::Error) -> Error { +impl From for Error { + fn from (error: hyper::error::Error) -> Error { Error::Http(error) } }