Skip to content

Commit b7c3bd6

Browse files
committed
fix bad merge
1 parent 7d43b91 commit b7c3bd6

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/test/fakes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<'a> FakeRelease<'a> {
116116
&self.package,
117117
tempdir.path(),
118118
&self.build_result,
119-
&self.default_target.unwrap_or("x86_64-unknown-linux-gnu"),
119+
self.default_target.as_deref().unwrap_or("x86_64-unknown-linux-gnu"),
120120
Some(source_meta),
121121
self.doc_targets,
122122
&self.cratesio_data,

src/web/rustdoc.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
226226
req_path.insert(2, &version);
227227

228228
// if visiting the full path to the default target, remove the target from the path
229+
// expects a req_path that looks like `/rustdoc/:crate/:version[/:target]/.*`
229230
let crate_details = cexpect!(CrateDetails::new(&conn, &name, &version));
230231
if req_path[3] == crate_details.metadata.default_target {
231232
let path = [base, req_path[1..3].join("/"), req_path[4..].join("/")].join("/");
@@ -243,16 +244,6 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
243244
path
244245
};
245246

246-
// if visiting the full path to the default target, remove the target from the path
247-
// expects a req_path that looks like `/rustdoc/:crate/:version[/:target]/.*`
248-
let crate_details = cexpect!(CrateDetails::new(&conn, &name, &version));
249-
debug!("req_path: {}, default_target: {}", req_path.join("/"), crate_details.metadata.default_target);
250-
if req_path[3] == crate_details.metadata.default_target {
251-
let path = [base, req_path[1..3].join("/"), req_path[4..].join("/")].join("/");
252-
let canonical = Url::parse(&path).expect("got an invalid URL to start");
253-
return Ok(super::redirect(canonical));
254-
}
255-
256247
let file = match File::from_path(&conn, &path) {
257248
Some(f) => f,
258249
None => return Err(IronError::new(Nope::ResourceNotFound, status::NotFound)),

0 commit comments

Comments
 (0)