mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Put cfg in a scope so it's not borrowed twice
This commit is contained in:
parent
0cecbd6732
commit
0989dc1c3d
@ -35,15 +35,16 @@ pub fn doc(ws: &Workspace<'_>, options: &DocOptions) -> CargoResult<()> {
|
||||
.join(&name)
|
||||
.join("index.html");
|
||||
if path.exists() {
|
||||
let config_browser = {
|
||||
let cfg = ws.config().get::<CargoDocConfig>("doc")?;
|
||||
|
||||
cfg.browser
|
||||
.map(|path_args| (path_args.path.resolve_program(ws.config()), path_args.args))
|
||||
};
|
||||
|
||||
let mut shell = ws.config().shell();
|
||||
shell.status("Opening", path.display())?;
|
||||
let cfg = ws.config().get::<CargoDocConfig>("doc")?;
|
||||
open_docs(
|
||||
&path,
|
||||
&mut shell,
|
||||
cfg.browser
|
||||
.map(|path_args| (path_args.path.resolve_program(ws.config()), path_args.args)),
|
||||
)?;
|
||||
open_docs(&path, &mut shell, config_browser)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user