summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorleo60228 <leo@60228.dev>2020-05-28 09:54:19 -0400
committerPaul Woolcock <paul@woolcock.us>2020-06-08 14:46:16 -0400
commit7e67e10bc473311602e5d9704c7ceaa96bdb2581 (patch)
tree21a5a952768480aa302ffc01ecf1eb45005ce049
parent791bc83387bbac4fb6ff46f4cf1153e37837b626 (diff)
Remove url 2.x
I thought tungstenite needed it, but it doesn't.
-rw-r--r--Cargo.toml3
-rw-r--r--src/errors.rs5
-rw-r--r--src/lib.rs7
-rw-r--r--src/page.rs2
-rw-r--r--src/registration.rs2
5 files changed, 6 insertions, 13 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 4f03ffb..6a549ba 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,6 +18,7 @@ serde_derive = "1"
serde_json = "1"
serde_urlencoded = "0.6.1"
serde_qs = "0.4.5"
+url = "1"
tap-reader = "1"
try_from = "0.3.2"
toml = { version = "0.5.0", optional = true }
@@ -25,8 +26,6 @@ hyper-old-types = "0.11.0"
envy = { version = "0.4.0", optional = true }
log = "0.4.6"
tungstenite = "0.10.1"
-url = "2.1.1"
-url1x = { version = "1", package = "url" }
[dependencies.chrono]
version = "0.4"
diff --git a/src/errors.rs b/src/errors.rs
index 65e5fcc..f4d62b4 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -12,7 +12,6 @@ use tomlcrate::de::Error as TomlDeError;
#[cfg(feature = "toml")]
use tomlcrate::ser::Error as TomlSerError;
use url::ParseError as UrlError;
-use url1x::ParseError as ReqwestUrlError;
use tungstenite::error::Error as WebSocketError;
/// Convience type over `std::result::Result` with `Error` as the error type.
@@ -35,8 +34,6 @@ pub enum Error {
Io(IoError),
/// Wrapper around the `url::ParseError` struct.
Url(UrlError),
- /// Wrapper around the `url::ParseError` struct.
- ReqwestUrl(ReqwestUrlError),
/// Missing Client Id.
ClientIdRequired,
/// Missing Client Secret.
@@ -85,7 +82,6 @@ impl error::Error for Error {
Error::Http(ref e) => e,
Error::Io(ref e) => e,
Error::Url(ref e) => e,
- Error::ReqwestUrl(ref e) => e,
#[cfg(feature = "toml")]
Error::TomlSer(ref e) => e,
#[cfg(feature = "toml")]
@@ -146,7 +142,6 @@ from! {
SerdeError, Serde,
UrlEncodedError, UrlEncoded,
UrlError, Url,
- ReqwestUrlError, ReqwestUrl,
ApiError, Api,
#[cfg(feature = "toml")] TomlSerError, TomlSer,
#[cfg(feature = "toml")] TomlDeError, TomlDe,
diff --git a/src/lib.rs b/src/lib.rs
index b82099c..7dccb5f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -89,7 +89,6 @@ extern crate serde_urlencoded;
extern crate tap_reader;
extern crate try_from;
extern crate url;
-extern crate url1x;
extern crate tungstenite;
#[cfg(feature = "env")]
@@ -776,7 +775,7 @@ impl<H: HttpSend> MastodonBuilder<H> {
pub struct MastodonUnauth<H: HttpSend = HttpSender> {
client: Client,
http_sender: H,
- base: reqwest::Url,
+ base: url::Url,
}
impl MastodonUnauth<HttpSender> {
@@ -790,13 +789,13 @@ impl MastodonUnauth<HttpSender> {
Ok(MastodonUnauth {
client: Client::new(),
http_sender: HttpSender,
- base: reqwest::Url::parse(&base)?,
+ base: url::Url::parse(&base)?,
})
}
}
impl<H: HttpSend> MastodonUnauth<H> {
- fn route(&self, url: &str) -> Result<reqwest::Url> {
+ fn route(&self, url: &str) -> Result<url::Url> {
Ok(self.base.join(url)?)
}
diff --git a/src/page.rs b/src/page.rs
index 09a2dca..3a47ce6 100644
--- a/src/page.rs
+++ b/src/page.rs
@@ -3,7 +3,7 @@ use entities::itemsiter::ItemsIter;
use hyper_old_types::header::{parsing, Link, RelationType};
use reqwest::{header::LINK, Response};
use serde::Deserialize;
-use reqwest::Url;
+use url::Url;
use http_send::HttpSend;
diff --git a/src/registration.rs b/src/registration.rs
index 8417b40..7aba7c5 100644
--- a/src/registration.rs
+++ b/src/registration.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
use reqwest::{Client, RequestBuilder, Response};
use try_from::TryInto;
-use url1x::percent_encoding::{utf8_percent_encode, DEFAULT_ENCODE_SET};
+use url::percent_encoding::{utf8_percent_encode, DEFAULT_ENCODE_SET};
use apps::{App, AppBuilder};
use http_send::{HttpSend, HttpSender};