Skip to content

Commit 6606b49

Browse files
lhvyVeykril
andauthored
Reduce allocation in builtin_crates
Co-authored-by: Lukas Wirth <[email protected]>
1 parent f713cfb commit 6606b49

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/ide_db/src/helpers/famous_defs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl FamousDefs<'_, '_> {
8080
self.find_crate("proc_macro")
8181
}
8282

83-
pub fn builtin_crates(&self) -> Vec<Crate> {
83+
pub fn builtin_crates(&self) -> impl Iterator<Item = Crate> {
8484
IntoIterator::into_iter([
8585
self.std(),
8686
self.core(),
@@ -89,7 +89,6 @@ impl FamousDefs<'_, '_> {
8989
self.proc_macro(),
9090
])
9191
.filter_map(|it| it)
92-
.collect()
9392
}
9493

9594
fn find_trait(&self, path: &str) -> Option<Trait> {

0 commit comments

Comments
 (0)