Skip to content

Commit b44d07d

Browse files
committed
remove unwraps
1 parent 46c24b7 commit b44d07d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/cargo/ops/cargo_doc.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,17 @@ pub fn doc(manifest_path: &Path,
6262
}
6363

6464
fn build_markdown_docs(manifest_path: &Path) -> CargoResult<()> {
65-
let docs_dir = manifest_path.parent().unwrap().join("doc");
66-
let target_dir = manifest_path.parent().unwrap().join("target/doc");
65+
let docs_dir = if let Some(dir) = manifest_path.parent() {
66+
dir.join("doc")
67+
} else {
68+
return Ok(());
69+
};
70+
71+
let target_dir = if let Some(dir) = manifest_path.parent() {
72+
dir.join("target/doc")
73+
} else {
74+
return Ok(());
75+
};
6776

6877
try!(fs::create_dir_all(&target_dir));
6978

0 commit comments

Comments
 (0)