mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
Correctly handle --open argument on doc command
This commit is contained in:
+10
-6
@@ -479,12 +479,16 @@ fn run(self, builder: &Builder<'_>) {
|
||||
// Look for library/std, library/core etc in the `x.py doc` arguments and
|
||||
// open the corresponding rendered docs.
|
||||
for path in builder.paths.iter().map(components_simplified) {
|
||||
if path.get(0) == Some(&"library") {
|
||||
let requested_crate = &path[1];
|
||||
if krates.contains(&requested_crate) {
|
||||
let index = out.join(requested_crate).join("index.html");
|
||||
open(builder, &index);
|
||||
}
|
||||
let requested_crate = if path.get(0) == Some(&"library") {
|
||||
&path[1]
|
||||
} else if !path.is_empty() {
|
||||
&path[0]
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
if krates.contains(&requested_crate) {
|
||||
let index = out.join(requested_crate).join("index.html");
|
||||
open(builder, &index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user