mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 19:23:50 +00:00
Avoid an unnecessary collect
This commit is contained in:
parent
343b14f7e0
commit
30ce8b20ec
@ -751,9 +751,7 @@ fn collect_attrs(
|
||||
.chain(inner_docs.into_iter().flatten())
|
||||
.map(|docs_text| (docs_text.syntax().text_range().start(), Either::Right(docs_text)));
|
||||
// sort here by syntax node offset because the source can have doc attributes and doc strings be interleaved
|
||||
let attrs: Vec<_> = docs.chain(attrs).sorted_by_key(|&(offset, _)| offset).collect();
|
||||
|
||||
attrs.into_iter().map(|(_, attr)| attr)
|
||||
docs.chain(attrs).sorted_by_key(|&(offset, _)| offset).map(|(_, attr)| attr)
|
||||
}
|
||||
|
||||
pub(crate) fn variants_attrs_source_map(
|
||||
|
Loading…
Reference in New Issue
Block a user