Skip to content

Commit 733757f

Browse files
m-ou-sejyn514
authored andcommitted
Add /rustdoc redirect.
1 parent b8928f0 commit 733757f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/web/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,12 @@ mod test {
728728
// with or without slash
729729
assert_redirect("/rustc", target, web)?;
730730
assert_redirect("/rustc/", target, web)?;
731+
732+
let target = "https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/";
733+
// with or without slash
734+
assert_redirect("/rustdoc", target, web)?;
735+
assert_redirect("/rustdoc/", target, web)?;
736+
731737
Ok(())
732738
})
733739
}

src/web/routes.rs

+5
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ pub(super) fn build_routes() -> Routes {
170170
"/rustc",
171171
super::rustdoc::RustLangRedirector::new("nightly", "nightly-rustc"),
172172
);
173+
// redirect rustdoc to nightly rustdoc docs
174+
routes.internal_page(
175+
"/rustdoc",
176+
super::rustdoc::RustLangRedirector::new("nightly", "nightly-rustc/rustdoc"),
177+
);
173178

174179
routes
175180
}

0 commit comments

Comments
 (0)