Skip to content

Commit c28427a

Browse files
committed
Simplify conversion
1 parent 1a78a89 commit c28427a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/librustdoc/json/mod.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -210,21 +210,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
210210
debug!("Done with crate");
211211
let mut index = (*self.index).clone().into_inner();
212212
index.extend(self.get_trait_items(cache));
213-
let len = index.len();
214-
// This needs to be the default HashMap for compatibility with the public interface for
215-
// rustdoc-json
216-
#[allow(rustc::default_hash_types)]
217213
let output = types::Crate {
218214
root: types::Id(String::from("0:0")),
219215
crate_version: krate.version.clone(),
220216
includes_private: cache.document_private,
221-
index: index.into_iter().fold(
222-
std::collections::HashMap::with_capacity(len),
223-
|mut acc, (key, val)| {
224-
acc.insert(key, val);
225-
acc
226-
},
227-
),
217+
index: index.into_iter().collect(),
228218
paths: cache
229219
.paths
230220
.clone()

0 commit comments

Comments
 (0)