From: Aleksey Kladov Date: Wed, 14 Dec 2016 22:41:31 +0000 (+0300) Subject: cargo doc: show where are docs X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~11^2~79^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=68733896d36081ac6463100615a033804f02c503;p=cargo.git cargo doc: show where are docs --- diff --git a/src/cargo/ops/cargo_doc.rs b/src/cargo/ops/cargo_doc.rs index eb1894fde..29de8aea9 100644 --- a/src/cargo/ops/cargo_doc.rs +++ b/src/cargo/ops/cargo_doc.rs @@ -70,6 +70,7 @@ pub fn doc(ws: &Workspace, options: &DocOptions) -> CargoResult<()> { let path = path.into_path_unlocked(); if fs::metadata(&path).is_ok() { let mut shell = options.compile_opts.config.shell(); + shell.status("Opening", path.display())?; match open_docs(&path) { Ok(m) => shell.status("Launching", m)?, Err(e) => { @@ -111,15 +112,15 @@ fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> { #[cfg(target_os = "windows")] fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> { match Command::new("cmd").arg("/C").arg(path).status() { - Ok(_) => return Ok("cmd /C"), - Err(_) => return Err(vec!["cmd /C"]), - }; + Ok(_) => Ok("cmd /C"), + Err(_) => Err(vec!["cmd /C"]), + } } #[cfg(target_os = "macos")] fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> { match Command::new("open").arg(path).status() { - Ok(_) => return Ok("open"), - Err(_) => return Err(vec!["open"]), - }; + Ok(_) => Ok("open"), + Err(_) => Err(vec!["open"]), + } }