mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 12:33:57 +00:00
Simplify conversion
This commit is contained in:
parent
3c2806957e
commit
cca4eea6f9
|
@ -205,7 +205,6 @@ fn after_krate(
|
|||
debug!("Done with crate");
|
||||
let mut index = (*self.index).clone().into_inner();
|
||||
index.extend(self.get_trait_items());
|
||||
let len = index.len();
|
||||
// This needs to be the default HashMap for compatibility with the public interface for
|
||||
// rustdoc-json
|
||||
#[allow(rustc::default_hash_types)]
|
||||
|
@ -213,13 +212,7 @@ fn after_krate(
|
|||
root: types::Id(String::from("0:0")),
|
||||
crate_version: krate.version.clone(),
|
||||
includes_private: self.cache.document_private,
|
||||
index: index.into_iter().fold(
|
||||
std::collections::HashMap::with_capacity(len),
|
||||
|mut acc, (key, val)| {
|
||||
acc.insert(key, val);
|
||||
acc
|
||||
},
|
||||
),
|
||||
index: index.into_iter().collect(),
|
||||
paths: self
|
||||
.cache
|
||||
.paths
|
||||
|
|
Loading…
Reference in a new issue