Simplify conversion
This commit is contained in:
parent
3c2806957e
commit
cca4eea6f9
1 changed files with 1 additions and 8 deletions
|
@ -205,7 +205,6 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
|
||||||
debug!("Done with crate");
|
debug!("Done with crate");
|
||||||
let mut index = (*self.index).clone().into_inner();
|
let mut index = (*self.index).clone().into_inner();
|
||||||
index.extend(self.get_trait_items());
|
index.extend(self.get_trait_items());
|
||||||
let len = index.len();
|
|
||||||
// This needs to be the default HashMap for compatibility with the public interface for
|
// This needs to be the default HashMap for compatibility with the public interface for
|
||||||
// rustdoc-json
|
// rustdoc-json
|
||||||
#[allow(rustc::default_hash_types)]
|
#[allow(rustc::default_hash_types)]
|
||||||
|
@ -213,13 +212,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
|
||||||
root: types::Id(String::from("0:0")),
|
root: types::Id(String::from("0:0")),
|
||||||
crate_version: krate.version.clone(),
|
crate_version: krate.version.clone(),
|
||||||
includes_private: self.cache.document_private,
|
includes_private: self.cache.document_private,
|
||||||
index: index.into_iter().fold(
|
index: index.into_iter().collect(),
|
||||||
std::collections::HashMap::with_capacity(len),
|
|
||||||
|mut acc, (key, val)| {
|
|
||||||
acc.insert(key, val);
|
|
||||||
acc
|
|
||||||
},
|
|
||||||
),
|
|
||||||
paths: self
|
paths: self
|
||||||
.cache
|
.cache
|
||||||
.paths
|
.paths
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue