]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/lib.rs
Rollup merge of #23738 - alexcrichton:snapshots, r=cmr
[rust.git] / src / librustdoc / lib.rs
index 62c9199a0fa46fdb41196f5069704e9349e2c06f..12c71b1437ac4a898c008ee474b5a6119364e9f8 100644 (file)
@@ -352,9 +352,7 @@ fn parse_externs(matches: &getopts::Matches) -> Result<core::Externs, String> {
             }
         };
         let name = name.to_string();
-        let locs = externs.entry(name).get().unwrap_or_else(
-            |vacant_entry| vacant_entry.insert(Vec::with_capacity(1)));
-        locs.push(location.to_string());
+        externs.entry(name).or_insert(vec![]).push(location.to_string());
     }
     Ok(externs)
 }