File tree Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use crate::core::{Shell, Workspace};
2
2
use crate :: ops;
3
3
use crate :: util:: config:: PathAndArgs ;
4
4
use crate :: util:: CargoResult ;
5
- use serde:: Deserialize ;
6
5
use std:: path:: Path ;
7
6
use std:: path:: PathBuf ;
8
7
use std:: process:: Command ;
@@ -16,13 +15,6 @@ pub struct DocOptions {
16
15
pub compile_opts : ops:: CompileOptions ,
17
16
}
18
17
19
- #[ derive( Deserialize ) ]
20
- struct CargoDocConfig {
21
- /// Browser to use to open docs. If this is unset, the value of the environment variable
22
- /// `BROWSER` will be used.
23
- browser : Option < PathAndArgs > ,
24
- }
25
-
26
18
/// Main method for `cargo doc`.
27
19
pub fn doc ( ws : & Workspace < ' _ > , options : & DocOptions ) -> CargoResult < ( ) > {
28
20
let compilation = ops:: compile ( ws, & options. compile_opts ) ?;
@@ -36,10 +28,8 @@ pub fn doc(ws: &Workspace<'_>, options: &DocOptions) -> CargoResult<()> {
36
28
. join ( "index.html" ) ;
37
29
if path. exists ( ) {
38
30
let config_browser = {
39
- let cfg = ws. config ( ) . get :: < CargoDocConfig > ( "doc" ) ?;
40
-
41
- cfg. browser
42
- . map ( |path_args| ( path_args. path . resolve_program ( ws. config ( ) ) , path_args. args ) )
31
+ let cfg: Option < PathAndArgs > = ws. config ( ) . get ( "doc.browser" ) ?;
32
+ cfg. map ( |path_args| ( path_args. path . resolve_program ( ws. config ( ) ) , path_args. args ) )
43
33
} ;
44
34
45
35
let mut shell = ws. config ( ) . shell ( ) ;
Original file line number Diff line number Diff line change @@ -1188,13 +1188,12 @@ fn doc_extern_map_local() {
1188
1188
p. change_file (
1189
1189
".cargo/config.toml" ,
1190
1190
r#"
1191
- [doc.extern-map]
1192
- std = "local"
1191
+ [doc.extern-map]
1192
+ std = "local"
1193
1193
"# ,
1194
1194
) ;
1195
1195
1196
-
1197
- p. cargo ( "doc -Zrustdoc-map --open" )
1196
+ p. cargo ( "doc -v --no-deps -Zrustdoc-map --open" )
1198
1197
. env ( "BROWSER" , "echo" )
1199
1198
. masquerade_as_nightly_cargo ( )
1200
1199
. with_stderr_contains ( "[..] Documenting foo v0.1.0 ([..])" )
You can’t perform that action at this time.
0 commit comments