Skip to content

Commit

Permalink
Make cargo doc --open --target TARGET work as expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
lifthrasiir committed Aug 13, 2016
1 parent c205132 commit 60afff0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/ops/cargo_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ pub fn doc(ws: &Workspace,
// Don't bother locking here as if this is getting deleted there's
// nothing we can do about it and otherwise if it's getting overwritten
// then that's also ok!
let target_dir = ws.target_dir();
let mut target_dir = ws.target_dir();
if let Some(triple) = options.compile_opts.target {
target_dir.push(Path::new(triple).file_stem().unwrap());
}
let path = target_dir.join("doc").join(&name).join("index.html");
let path = path.into_path_unlocked();
if fs::metadata(&path).is_ok() {
Expand Down

0 comments on commit 60afff0

Please sign in to comment.