A package will always contain at least one library or a binary.
authorEsteve Fernandez <esteve@apache.org>
Tue, 29 May 2018 09:03:16 +0000 (11:03 +0200)
committerEsteve Fernandez <esteve@apache.org>
Tue, 29 May 2018 09:03:16 +0000 (11:03 +0200)
src/cargo/ops/cargo_doc.rs

index ab3aa62cee19a3e002d25dae03853dcca8f50229..df394f5f0f063f531cdd097207ef92b849ea6966 100644 (file)
@@ -78,8 +78,6 @@ pub fn doc(ws: &Workspace, options: &DocOptions) -> CargoResult<()> {
                     .collect::<Vec<_>>()
                     .join("\n  ")
             );
-        } else if pkgs.len() == 1 {
-            pkgs[0].name().replace("-", "_")
         } else {
             match lib_names.keys().chain(bin_names.keys()).nth(0) {
                 Some(s) => s.to_string(),