Skip to content

Commit 00cdbce

Browse files
Merge #8453
8453: Avoid an unnecessary `collect` r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 parents 343b14f + 30ce8b2 commit 00cdbce

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/hir_def/src/attr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,7 @@ fn collect_attrs(
751751
.chain(inner_docs.into_iter().flatten())
752752
.map(|docs_text| (docs_text.syntax().text_range().start(), Either::Right(docs_text)));
753753
// sort here by syntax node offset because the source can have doc attributes and doc strings be interleaved
754-
let attrs: Vec<_> = docs.chain(attrs).sorted_by_key(|&(offset, _)| offset).collect();
755-
756-
attrs.into_iter().map(|(_, attr)| attr)
754+
docs.chain(attrs).sorted_by_key(|&(offset, _)| offset).map(|(_, attr)| attr)
757755
}
758756

759757
pub(crate) fn variants_attrs_source_map(

0 commit comments

Comments
 (0)