parent
ccea2162e0
commit
e8228ce77e
@ -1 +1,2 @@
|
||||
/http-0.1.5.crate
|
||||
/http-0.1.6.crate
|
||||
|
@ -1,157 +0,0 @@
|
||||
From 246a3a0076a731ed919d6d10669150e3872ed049 Mon Sep 17 00:00:00 2001
|
||||
From: Sean McArthur <sean@seanmonstar.com>
|
||||
Date: Fri, 6 Apr 2018 11:21:17 -0700
|
||||
Subject: [PATCH] fix conflicts with new TryFrom trait, deprecated AsciiExt
|
||||
(#194)
|
||||
|
||||
---
|
||||
src/header/name.rs | 4 ++--
|
||||
src/method.rs | 4 ++--
|
||||
src/request.rs | 8 ++++----
|
||||
src/response.rs | 6 +++---
|
||||
src/uri/authority.rs | 3 ++-
|
||||
src/uri/mod.rs | 3 ++-
|
||||
src/uri/scheme.rs | 3 ++-
|
||||
7 files changed, 17 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/header/name.rs b/src/header/name.rs
|
||||
index 71ae5184d9a6..4596f2cda1c1 100644
|
||||
--- a/src/header/name.rs
|
||||
+++ b/src/header/name.rs
|
||||
@@ -125,14 +125,14 @@ macro_rules! standard_headers {
|
||||
let bytes: Bytes =
|
||||
HeaderName::from_bytes(name_bytes).unwrap().into();
|
||||
assert_eq!(bytes, name_bytes);
|
||||
- assert_eq!(HeaderName::try_from(Bytes::from(name_bytes)).unwrap(), std);
|
||||
+ assert_eq!(HeaderName::from_bytes(name_bytes).unwrap(), std);
|
||||
|
||||
// Test upper case
|
||||
let upper = name.to_uppercase().to_string();
|
||||
let bytes: Bytes =
|
||||
HeaderName::from_bytes(upper.as_bytes()).unwrap().into();
|
||||
assert_eq!(bytes, name.as_bytes());
|
||||
- assert_eq!(HeaderName::try_from(Bytes::from(upper.as_bytes())).unwrap(),
|
||||
+ assert_eq!(HeaderName::from_bytes(upper.as_bytes()).unwrap(),
|
||||
std);
|
||||
|
||||
|
||||
diff --git a/src/method.rs b/src/method.rs
|
||||
index 6f28fef840c2..d8f1bfbfb72c 100644
|
||||
--- a/src/method.rs
|
||||
+++ b/src/method.rs
|
||||
@@ -322,7 +322,7 @@ impl<'a> HttpTryFrom<&'a str> for Method {
|
||||
|
||||
#[inline]
|
||||
fn try_from(t: &'a str) -> Result<Self, Self::Error> {
|
||||
- Method::try_from(t.as_bytes())
|
||||
+ HttpTryFrom::try_from(t.as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ impl FromStr for Method {
|
||||
|
||||
#[inline]
|
||||
fn from_str(t: &str) -> Result<Self, Self::Err> {
|
||||
- Method::try_from(t)
|
||||
+ HttpTryFrom::try_from(t)
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/request.rs b/src/request.rs
|
||||
index 7917b1465b20..b71d38e15f0a 100644
|
||||
--- a/src/request.rs
|
||||
+++ b/src/request.rs
|
||||
@@ -764,7 +764,7 @@ impl Builder {
|
||||
where Method: HttpTryFrom<T>,
|
||||
{
|
||||
if let Some(head) = head(&mut self.head, &self.err) {
|
||||
- match Method::try_from(method) {
|
||||
+ match HttpTryFrom::try_from(method) {
|
||||
Ok(s) => head.method = s,
|
||||
Err(e) => self.err = Some(e.into()),
|
||||
}
|
||||
@@ -793,7 +793,7 @@ impl Builder {
|
||||
where Uri: HttpTryFrom<T>,
|
||||
{
|
||||
if let Some(head) = head(&mut self.head, &self.err) {
|
||||
- match Uri::try_from(uri) {
|
||||
+ match HttpTryFrom::try_from(uri) {
|
||||
Ok(s) => head.uri = s,
|
||||
Err(e) => self.err = Some(e.into()),
|
||||
}
|
||||
@@ -848,9 +848,9 @@ impl Builder {
|
||||
HeaderValue: HttpTryFrom<V>
|
||||
{
|
||||
if let Some(head) = head(&mut self.head, &self.err) {
|
||||
- match HeaderName::try_from(key) {
|
||||
+ match <HeaderName as HttpTryFrom<K>>::try_from(key) {
|
||||
Ok(key) => {
|
||||
- match HeaderValue::try_from(value) {
|
||||
+ match <HeaderValue as HttpTryFrom<V>>::try_from(value) {
|
||||
Ok(value) => { head.headers.append(key, value); }
|
||||
Err(e) => self.err = Some(e.into()),
|
||||
}
|
||||
diff --git a/src/response.rs b/src/response.rs
|
||||
index cb780dce37f4..edfbb56b4e20 100644
|
||||
--- a/src/response.rs
|
||||
+++ b/src/response.rs
|
||||
@@ -561,7 +561,7 @@ impl Builder {
|
||||
where StatusCode: HttpTryFrom<T>,
|
||||
{
|
||||
if let Some(head) = head(&mut self.head, &self.err) {
|
||||
- match StatusCode::try_from(status) {
|
||||
+ match HttpTryFrom::try_from(status) {
|
||||
Ok(s) => head.status = s,
|
||||
Err(e) => self.err = Some(e.into()),
|
||||
}
|
||||
@@ -616,9 +616,9 @@ impl Builder {
|
||||
HeaderValue: HttpTryFrom<V>
|
||||
{
|
||||
if let Some(head) = head(&mut self.head, &self.err) {
|
||||
- match HeaderName::try_from(key) {
|
||||
+ match <HeaderName as HttpTryFrom<K>>::try_from(key) {
|
||||
Ok(key) => {
|
||||
- match HeaderValue::try_from(value) {
|
||||
+ match <HeaderValue as HttpTryFrom<V>>::try_from(value) {
|
||||
Ok(value) => { head.headers.append(key, value); }
|
||||
Err(e) => self.err = Some(e.into()),
|
||||
}
|
||||
diff --git a/src/uri/authority.rs b/src/uri/authority.rs
|
||||
index 89229b109fc7..1fd78704e832 100644
|
||||
--- a/src/uri/authority.rs
|
||||
+++ b/src/uri/authority.rs
|
||||
@@ -1,4 +1,5 @@
|
||||
-#[allow(unused)]
|
||||
+// Deprecated in 1.26, needed until our minimum version is >=1.23.
|
||||
+#[allow(unused, deprecated)]
|
||||
use std::ascii::AsciiExt;
|
||||
use std::{cmp, fmt, str};
|
||||
use std::hash::{Hash, Hasher};
|
||||
diff --git a/src/uri/mod.rs b/src/uri/mod.rs
|
||||
index bd980b592723..85b276bd9763 100644
|
||||
--- a/src/uri/mod.rs
|
||||
+++ b/src/uri/mod.rs
|
||||
@@ -28,7 +28,8 @@ use byte_str::ByteStr;
|
||||
use bytes::Bytes;
|
||||
|
||||
use std::{fmt, u8, u16};
|
||||
-#[allow(unused)]
|
||||
+// Deprecated in 1.26, needed until our minimum version is >=1.23.
|
||||
+#[allow(unused, deprecated)]
|
||||
use std::ascii::AsciiExt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::str::{self, FromStr};
|
||||
diff --git a/src/uri/scheme.rs b/src/uri/scheme.rs
|
||||
index ae40ff6ece31..5fa1e9bb0675 100644
|
||||
--- a/src/uri/scheme.rs
|
||||
+++ b/src/uri/scheme.rs
|
||||
@@ -1,4 +1,5 @@
|
||||
-#[allow(unused)]
|
||||
+// Deprecated in 1.26, needed until our minimum version is >=1.23.
|
||||
+#[allow(unused, deprecated)]
|
||||
use std::ascii::AsciiExt;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
--
|
||||
2.17.0
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- http-0.1.5/Cargo.toml 1970-01-01T01:00:00+01:00
|
||||
+++ http-0.1.5/Cargo.toml 2018-03-09T08:47:36.859960+01:00
|
||||
@@ -36,7 +36,7 @@
|
||||
[dependencies.fnv]
|
||||
version = "1.0.5"
|
||||
[dev-dependencies.ordermap]
|
||||
-version = "0.3"
|
||||
+version = "0.4"
|
||||
|
||||
[dev-dependencies.quickcheck]
|
||||
version = "0.6"
|
@ -1 +1 @@
|
||||
SHA512 (http-0.1.5.crate) = 2b36e6dd1693a02f837f4560f943a35cb5e068d46080f68bdf309bf12cc231b0f4df8cfbdcdea3af5d923c34ca58f3cf04f89cae5283ef26498649201e6f22d5
|
||||
SHA512 (http-0.1.6.crate) = 8d8e734bb169cbef17aa828e6f5245934034c4f1ddcf5bf73c3d49e4d3e63a862bb4c10dc75d626199db9094a29484697fc162905a492cf3d5b47d952c9db7ed
|
||||
|
Loading…
Reference in new issue