File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,9 @@ pub fn search_handler(req: &mut Request) -> IronResult<Response> {
483
483
return Ok ( resp) ;
484
484
}
485
485
486
-
486
+ // since we never pass a version into `match_version` here, we'll never get
487
+ // `MatchVersion::Exact`, so the distinction between `Exact` and `Semver` doesn't
488
+ // matter
487
489
if let Some ( version) = match_version ( & conn, & query, None ) . into_option ( ) {
488
490
// FIXME: This is a super dirty way to check if crate have rustdocs generated.
489
491
// match_version should handle this instead of this code block.
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ impl ToJson for RustdocPage {
66
66
}
67
67
68
68
69
-
69
+ /// Handler called for `/:crate` and `/:crate/:version` URLs. Automatically redirects to the docs
70
+ /// or crate details page based on whether the given crate version was successfully built.
70
71
pub fn rustdoc_redirector_handler ( req : & mut Request ) -> IronResult < Response > {
71
72
72
73
fn redirect_to_doc ( req : & Request ,
@@ -120,6 +121,8 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult<Response> {
120
121
121
122
let conn = extension ! ( req, Pool ) ;
122
123
124
+ // it doesn't matter if the version that was given was exact or not, since we're redirecting
125
+ // anyway
123
126
let version = match match_version ( & conn, & crate_name, req_version) . into_option ( ) {
124
127
Some ( v) => v,
125
128
None => return Err ( IronError :: new ( Nope :: CrateNotFound , status:: NotFound ) ) ,
You can’t perform that action at this time.
0 commit comments