提交 cc44ce0a 编写于 作者: G Guillaume Gomez

Correctly handle --open argument on doc command

上级 62652865
...@@ -479,15 +479,19 @@ fn run(self, builder: &Builder<'_>) { ...@@ -479,15 +479,19 @@ fn run(self, builder: &Builder<'_>) {
// Look for library/std, library/core etc in the `x.py doc` arguments and // Look for library/std, library/core etc in the `x.py doc` arguments and
// open the corresponding rendered docs. // open the corresponding rendered docs.
for path in builder.paths.iter().map(components_simplified) { for path in builder.paths.iter().map(components_simplified) {
if path.get(0) == Some(&"library") { let requested_crate = if path.get(0) == Some(&"library") {
let requested_crate = &path[1]; &path[1]
} else if !path.is_empty() {
&path[0]
} else {
continue;
};
if krates.contains(&requested_crate) { if krates.contains(&requested_crate) {
let index = out.join(requested_crate).join("index.html"); let index = out.join(requested_crate).join("index.html");
open(builder, &index); open(builder, &index);
} }
} }
} }
}
} }
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册