Skip to content

Commit 760e3de

Browse files
committed
Fix src_path
1 parent 13b944c commit 760e3de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/docbuilder/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,18 +546,22 @@ impl DocBuilder {
546546
// check crate name
547547
let mut crate_path = PathBuf::from(&path);
548548
crate_path.push(&crte.name);
549-
src_path.push(&crate_path);
549+
src_path.push(&crte.name);
550550
if crate_path.exists() && src_path.exists() {
551551
return Ok((crate_path, src_path));
552552
}
553553

554554
// some crates are using '-' in their name but actual name contains '_'
555555
let actual_crate_name = &crte.name.replace("-", "_");
556+
// I need another fresh src_path here
557+
// FIXME: This function became a mess after I introduced src_path
558+
let mut src_path = self.crate_root_dir(crte, version_index);
559+
src_path.push("target/doc/src");
556560
// I think it's safe to push into path now
557561
path.push(actual_crate_name);
558562
src_path.push(actual_crate_name);
559563
if path.exists() && src_path.exists() {
560-
return Ok((crate_path, src_path));
564+
return Ok((path, src_path));
561565
}
562566

563567
Err(DocBuilderError::DocumentationNotFound)

0 commit comments

Comments
 (0)