File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -34,21 +34,19 @@ pub fn doc(ws: &Workspace, options: &DocOptions) -> CargoResult<()> {
3434
3535 let mut lib_names = HashSet :: new ( ) ;
3636 let mut bin_names = HashSet :: new ( ) ;
37- if specs. is_empty ( ) {
38- for package in & pkgs {
39- for target in package. targets ( ) . iter ( ) . filter ( |t| t. documented ( ) ) {
40- if target. is_lib ( ) {
41- assert ! ( lib_names. insert( target. crate_name( ) ) ) ;
42- } else {
43- assert ! ( bin_names. insert( target. crate_name( ) ) ) ;
44- }
37+ for package in & pkgs {
38+ for target in package. targets ( ) . iter ( ) . filter ( |t| t. documented ( ) ) {
39+ if target. is_lib ( ) {
40+ assert ! ( lib_names. insert( target. crate_name( ) ) ) ;
41+ } else {
42+ assert ! ( bin_names. insert( target. crate_name( ) ) ) ;
4543 }
46- for bin in bin_names . iter ( ) {
47- if lib_names . contains ( bin ) {
48- bail ! ( "cannot document a package where a library and a binary \
49- have the same name. Consider renaming one or marking \
50- the target as `doc = false`" )
51- }
44+ }
45+ for bin in bin_names . iter ( ) {
46+ if lib_names . contains ( bin ) {
47+ bail ! ( "cannot document a package where a library and a binary \
48+ have the same name. Consider renaming one or marking \
49+ the target as `doc = false`" )
5250 }
5351 }
5452 }
You can’t perform that action at this time.
0 commit comments