@@ -237,33 +237,31 @@ impl Handler for CratesfyiHandler {
237
237
panic ! ( "all cratesfyi errors should be of type Nope" ) ;
238
238
} ;
239
239
240
- match err {
241
- error:: Nope :: ResourceNotFound => {
242
- // print the path of the URL that triggered a 404 error
243
- struct DebugPath < ' a > ( & ' a iron:: Url ) ;
244
- impl < ' a > fmt:: Display for DebugPath < ' a > {
245
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
246
- for path_elem in self . 0 . path ( ) {
247
- write ! ( f, "/{}" , path_elem) ?;
248
- }
249
-
250
- if let Some ( query) = self . 0 . query ( ) {
251
- write ! ( f, "?{}" , query) ?;
252
- }
253
-
254
- if let Some ( hash) = self . 0 . fragment ( ) {
255
- write ! ( f, "#{}" , hash) ?;
256
- }
257
-
258
- Ok ( ( ) )
240
+ if let error:: Nope :: ResourceNotFound = err {
241
+ // print the path of the URL that triggered a 404 error
242
+ struct DebugPath < ' a > ( & ' a iron:: Url ) ;
243
+ impl < ' a > fmt:: Display for DebugPath < ' a > {
244
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
245
+ for path_elem in self . 0 . path ( ) {
246
+ write ! ( f, "/{}" , path_elem) ?;
247
+ }
248
+
249
+ if let Some ( query) = self . 0 . query ( ) {
250
+ write ! ( f, "?{}" , query) ?;
251
+ }
252
+
253
+ if let Some ( hash) = self . 0 . fragment ( ) {
254
+ write ! ( f, "#{}" , hash) ?;
259
255
}
260
- }
261
256
262
- debug ! ( "Path not found: {}" , DebugPath ( & req. url) ) ;
257
+ Ok ( ( ) )
258
+ }
263
259
}
264
- _ => { }
260
+
261
+ debug ! ( "Path not found: {}" , DebugPath ( & req. url) ) ;
265
262
}
266
263
264
+
267
265
Self :: chain ( err) . handle ( req)
268
266
} )
269
267
}
0 commit comments