File tree 1 file changed +20
-0
lines changed 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use std::io::prelude::*;
4
4
use std:: collections:: HashMap ;
5
5
use std:: error:: Error ;
6
6
use std:: net:: SocketAddr ;
7
+ use std:: fmt;
7
8
8
9
pub use self :: typemap:: TypeMap ;
9
10
mod typemap;
@@ -39,6 +40,25 @@ pub enum Method {
39
40
Other ( String )
40
41
}
41
42
43
+ impl fmt:: Display for Method {
44
+ fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
45
+ let s = match * self {
46
+ Method :: Get => "GET" ,
47
+ Method :: Post => "POST" ,
48
+ Method :: Put => "POST" ,
49
+ Method :: Delete => "DELETE" ,
50
+ Method :: Head => "HEAD" ,
51
+ Method :: Connect => "CONNECT" ,
52
+ Method :: Options => "OPTIONS" ,
53
+ Method :: Trace => "TRACE" ,
54
+ Method :: Patch => "PATCH" ,
55
+ Method :: Purge => "PURGE" ,
56
+ Method :: Other ( ref s) => s,
57
+ } ;
58
+ fmt. write_str ( s)
59
+ }
60
+ }
61
+
42
62
/// A Dictionary for extensions provided by the server or middleware
43
63
pub type Extensions = TypeMap ;
44
64
You can’t perform that action at this time.
0 commit comments