1
- #![ feature( core, std_misc) ]
2
-
3
- extern crate "route-recognizer" as router;
1
+ extern crate route_recognizer as router;
4
2
extern crate conduit;
5
3
6
4
use std:: collections:: hash_map:: { HashMap , Entry } ;
@@ -18,6 +16,7 @@ pub struct RouteBuilder {
18
16
unsafe impl Sync for RouteBuilder { }
19
17
unsafe impl Send for RouteBuilder { }
20
18
19
+ #[ derive( Debug ) ]
21
20
pub struct RouterError ( String ) ;
22
21
23
22
impl RouteBuilder {
@@ -95,7 +94,7 @@ impl conduit::Handler for RouteBuilder {
95
94
}
96
95
97
96
impl Error for RouterError {
98
- fn description ( & self ) -> & str { self . 0 . as_slice ( ) }
97
+ fn description ( & self ) -> & str { & self . 0 }
99
98
}
100
99
101
100
impl fmt:: Display for RouterError {
@@ -154,9 +153,7 @@ mod tests {
154
153
fn scheme ( & self ) -> Scheme { unimplemented ! ( ) }
155
154
fn host < ' a > ( & ' a self ) -> Host < ' a > { unimplemented ! ( ) }
156
155
fn virtual_root < ' a > ( & ' a self ) -> Option < & ' a str > { unimplemented ! ( ) }
157
- fn path < ' a > ( & ' a self ) -> & ' a str {
158
- self . path . as_slice ( )
159
- }
156
+ fn path < ' a > ( & ' a self ) -> & ' a str { & self . path }
160
157
fn query_string < ' a > ( & ' a self ) -> Option < & ' a str > { unimplemented ! ( ) }
161
158
fn remote_addr ( & self ) -> SocketAddr { unimplemented ! ( ) }
162
159
fn content_length ( & self ) -> Option < u64 > { unimplemented ! ( ) }
0 commit comments