diff --git a/0001-fix-conflicts-with-new-TryFrom-trait-deprecated-Asci.patch b/0001-fix-conflicts-with-new-TryFrom-trait-deprecated-Asci.patch new file mode 100644 index 0000000..6c279b4 --- /dev/null +++ b/0001-fix-conflicts-with-new-TryFrom-trait-deprecated-Asci.patch @@ -0,0 +1,157 @@ +From 246a3a0076a731ed919d6d10669150e3872ed049 Mon Sep 17 00:00:00 2001 +From: Sean McArthur +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 { +- 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 { +- 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, + { + 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, + { + 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 + { + if let Some(head) = head(&mut self.head, &self.err) { +- match HeaderName::try_from(key) { ++ match >::try_from(key) { + Ok(key) => { +- match HeaderValue::try_from(value) { ++ match >::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, + { + 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 + { + if let Some(head) = head(&mut self.head, &self.err) { +- match HeaderName::try_from(key) { ++ match >::try_from(key) { + Ok(key) => { +- match HeaderValue::try_from(value) { ++ match >::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 + diff --git a/rust-http.spec b/rust-http.spec index 018ee33..aa7832b 100644 --- a/rust-http.spec +++ b/rust-http.spec @@ -6,7 +6,7 @@ Name: rust-%{crate} Version: 0.1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Set of types for representing HTTP requests and responses License: MIT or ASL 2.0 @@ -16,6 +16,9 @@ Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{ # * Bump ordermap to 0.4, https://github.com/hyperium/http/pull/185 Patch0: http-0.1.5-fix-metadata.diff +# https://github.com/hyperium/http/pull/194 +Patch1: 0001-fix-conflicts-with-new-TryFrom-trait-deprecated-Asci.patch + ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging @@ -66,5 +69,8 @@ which use %{crate} from crates.io. %{cargo_registry}/%{crate}-%{version}/ %changelog +* Wed May 16 2018 Josh Stone - 0.1.5-2 +- Fix FTBFS from deprecated AsciiExt + * Fri Mar 09 2018 Igor Gnatenko - 0.1.5-1 - Initial package