5353//! ```
5454
5555use std:: any:: Any ;
56- use std:: convert:: TryFrom ;
56+ use std:: convert:: TryInto ;
5757use std:: fmt;
5858
5959use crate :: header:: { HeaderMap , HeaderName , HeaderValue } ;
@@ -231,8 +231,8 @@ impl Request<()> {
231231 /// ```
232232 pub fn get < T > ( uri : T ) -> Builder
233233 where
234- Uri : TryFrom < T > ,
235- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
234+ T : TryInto < Uri > ,
235+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
236236 {
237237 Builder :: new ( ) . method ( Method :: GET ) . uri ( uri)
238238 }
@@ -253,8 +253,8 @@ impl Request<()> {
253253 /// ```
254254 pub fn put < T > ( uri : T ) -> Builder
255255 where
256- Uri : TryFrom < T > ,
257- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
256+ T : TryInto < Uri > ,
257+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
258258 {
259259 Builder :: new ( ) . method ( Method :: PUT ) . uri ( uri)
260260 }
@@ -275,8 +275,8 @@ impl Request<()> {
275275 /// ```
276276 pub fn post < T > ( uri : T ) -> Builder
277277 where
278- Uri : TryFrom < T > ,
279- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
278+ T : TryInto < Uri > ,
279+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
280280 {
281281 Builder :: new ( ) . method ( Method :: POST ) . uri ( uri)
282282 }
@@ -297,8 +297,8 @@ impl Request<()> {
297297 /// ```
298298 pub fn delete < T > ( uri : T ) -> Builder
299299 where
300- Uri : TryFrom < T > ,
301- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
300+ T : TryInto < Uri > ,
301+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
302302 {
303303 Builder :: new ( ) . method ( Method :: DELETE ) . uri ( uri)
304304 }
@@ -320,8 +320,8 @@ impl Request<()> {
320320 /// ```
321321 pub fn options < T > ( uri : T ) -> Builder
322322 where
323- Uri : TryFrom < T > ,
324- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
323+ T : TryInto < Uri > ,
324+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
325325 {
326326 Builder :: new ( ) . method ( Method :: OPTIONS ) . uri ( uri)
327327 }
@@ -342,8 +342,8 @@ impl Request<()> {
342342 /// ```
343343 pub fn head < T > ( uri : T ) -> Builder
344344 where
345- Uri : TryFrom < T > ,
346- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
345+ T : TryInto < Uri > ,
346+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
347347 {
348348 Builder :: new ( ) . method ( Method :: HEAD ) . uri ( uri)
349349 }
@@ -364,8 +364,8 @@ impl Request<()> {
364364 /// ```
365365 pub fn connect < T > ( uri : T ) -> Builder
366366 where
367- Uri : TryFrom < T > ,
368- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
367+ T : TryInto < Uri > ,
368+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
369369 {
370370 Builder :: new ( ) . method ( Method :: CONNECT ) . uri ( uri)
371371 }
@@ -386,8 +386,8 @@ impl Request<()> {
386386 /// ```
387387 pub fn patch < T > ( uri : T ) -> Builder
388388 where
389- Uri : TryFrom < T > ,
390- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
389+ T : TryInto < Uri > ,
390+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
391391 {
392392 Builder :: new ( ) . method ( Method :: PATCH ) . uri ( uri)
393393 }
@@ -408,8 +408,8 @@ impl Request<()> {
408408 /// ```
409409 pub fn trace < T > ( uri : T ) -> Builder
410410 where
411- Uri : TryFrom < T > ,
412- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
411+ T : TryInto < Uri > ,
412+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
413413 {
414414 Builder :: new ( ) . method ( Method :: TRACE ) . uri ( uri)
415415 }
@@ -767,11 +767,11 @@ impl Builder {
767767 /// ```
768768 pub fn method < T > ( self , method : T ) -> Builder
769769 where
770- Method : TryFrom < T > ,
771- <Method as TryFrom < T > >:: Error : Into < crate :: Error > ,
770+ T : TryInto < Method > ,
771+ <T as TryInto < Method > >:: Error : Into < crate :: Error > ,
772772 {
773773 self . and_then ( move |mut head| {
774- let method = TryFrom :: try_from ( method) . map_err ( Into :: into) ?;
774+ let method = method. try_into ( ) . map_err ( Into :: into) ?;
775775 head. method = method;
776776 Ok ( head)
777777 } )
@@ -812,11 +812,11 @@ impl Builder {
812812 /// ```
813813 pub fn uri < T > ( self , uri : T ) -> Builder
814814 where
815- Uri : TryFrom < T > ,
816- <Uri as TryFrom < T > >:: Error : Into < crate :: Error > ,
815+ T : TryInto < Uri > ,
816+ <T as TryInto < Uri > >:: Error : Into < crate :: Error > ,
817817 {
818818 self . and_then ( move |mut head| {
819- head. uri = TryFrom :: try_from ( uri) . map_err ( Into :: into) ?;
819+ head. uri = uri. try_into ( ) . map_err ( Into :: into) ?;
820820 Ok ( head)
821821 } )
822822 }
@@ -900,14 +900,14 @@ impl Builder {
900900 /// ```
901901 pub fn header < K , V > ( self , key : K , value : V ) -> Builder
902902 where
903- HeaderName : TryFrom < K > ,
904- <HeaderName as TryFrom < K > >:: Error : Into < crate :: Error > ,
905- HeaderValue : TryFrom < V > ,
906- <HeaderValue as TryFrom < V > >:: Error : Into < crate :: Error > ,
903+ K : TryInto < HeaderName > ,
904+ <K as TryInto < HeaderName > >:: Error : Into < crate :: Error > ,
905+ V : TryInto < HeaderValue > ,
906+ <V as TryInto < HeaderValue > >:: Error : Into < crate :: Error > ,
907907 {
908908 self . and_then ( move |mut head| {
909- let name = < HeaderName as TryFrom < K > > :: try_from ( key) . map_err ( Into :: into) ?;
910- let value = < HeaderValue as TryFrom < V > > :: try_from ( value) . map_err ( Into :: into) ?;
909+ let name = key. try_into ( ) . map_err ( Into :: into) ?;
910+ let value = value. try_into ( ) . map_err ( Into :: into) ?;
911911 head. headers . try_append ( name, value) ?;
912912 Ok ( head)
913913 } )
0 commit comments