8453: Avoid an unnecessary `collect` r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2021-04-09 20:52:41 +00:00 committed by GitHub
commit 00cdbceb9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(