Skip to content

Commit bf06dab

Browse files
committed
fix conflicts with new TryFrom trait
1 parent 01521e2 commit bf06dab

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

src/method.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ impl<'a> HttpTryFrom<&'a str> for Method {
322322

323323
#[inline]
324324
fn try_from(t: &'a str) -> Result<Self, Self::Error> {
325-
Method::try_from(t.as_bytes())
325+
HttpTryFrom::try_from(t.as_bytes())
326326
}
327327
}
328328

@@ -331,7 +331,7 @@ impl FromStr for Method {
331331

332332
#[inline]
333333
fn from_str(t: &str) -> Result<Self, Self::Err> {
334-
Method::try_from(t)
334+
HttpTryFrom::try_from(t)
335335
}
336336
}
337337

src/request.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ impl Builder {
764764
where Method: HttpTryFrom<T>,
765765
{
766766
if let Some(head) = head(&mut self.head, &self.err) {
767-
match Method::try_from(method) {
767+
match HttpTryFrom::try_from(method) {
768768
Ok(s) => head.method = s,
769769
Err(e) => self.err = Some(e.into()),
770770
}
@@ -793,7 +793,7 @@ impl Builder {
793793
where Uri: HttpTryFrom<T>,
794794
{
795795
if let Some(head) = head(&mut self.head, &self.err) {
796-
match Uri::try_from(uri) {
796+
match HttpTryFrom::try_from(uri) {
797797
Ok(s) => head.uri = s,
798798
Err(e) => self.err = Some(e.into()),
799799
}
@@ -848,9 +848,9 @@ impl Builder {
848848
HeaderValue: HttpTryFrom<V>
849849
{
850850
if let Some(head) = head(&mut self.head, &self.err) {
851-
match HeaderName::try_from(key) {
851+
match <HeaderName as HttpTryFrom<K>>::try_from(key) {
852852
Ok(key) => {
853-
match HeaderValue::try_from(value) {
853+
match <HeaderValue as HttpTryFrom<V>>::try_from(value) {
854854
Ok(value) => { head.headers.append(key, value); }
855855
Err(e) => self.err = Some(e.into()),
856856
}

src/response.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ impl Builder {
561561
where StatusCode: HttpTryFrom<T>,
562562
{
563563
if let Some(head) = head(&mut self.head, &self.err) {
564-
match StatusCode::try_from(status) {
564+
match HttpTryFrom::try_from(status) {
565565
Ok(s) => head.status = s,
566566
Err(e) => self.err = Some(e.into()),
567567
}
@@ -616,9 +616,9 @@ impl Builder {
616616
HeaderValue: HttpTryFrom<V>
617617
{
618618
if let Some(head) = head(&mut self.head, &self.err) {
619-
match HeaderName::try_from(key) {
619+
match <HeaderName as HttpTryFrom<K>>::try_from(key) {
620620
Ok(key) => {
621-
match HeaderValue::try_from(value) {
621+
match <HeaderValue as HttpTryFrom<V>>::try_from(value) {
622622
Ok(value) => { head.headers.append(key, value); }
623623
Err(e) => self.err = Some(e.into()),
624624
}

src/uri/authority.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#[allow(unused)]
1+
// Deprecated in 1.26, needed until our minimum version is >=1.23.
2+
#[allow(unused, deprecated)]
23
use std::ascii::AsciiExt;
34
use std::{cmp, fmt, str};
45
use std::hash::{Hash, Hasher};

src/uri/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ use byte_str::ByteStr;
2828
use bytes::Bytes;
2929

3030
use std::{fmt, u8, u16};
31-
#[allow(unused)]
31+
// Deprecated in 1.26, needed until our minimum version is >=1.23.
32+
#[allow(unused, deprecated)]
3233
use std::ascii::AsciiExt;
3334
use std::hash::{Hash, Hasher};
3435
use std::str::{self, FromStr};

src/uri/scheme.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#[allow(unused)]
1+
// Deprecated in 1.26, needed until our minimum version is >=1.23.
2+
#[allow(unused, deprecated)]
23
use std::ascii::AsciiExt;
34
use std::fmt;
45
use std::hash::{Hash, Hasher};

0 commit comments

Comments
 (0)