Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/utils.rs')
| -rw-r--r-- | crates/hir_ty/src/utils.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/hir_ty/src/utils.rs b/crates/hir_ty/src/utils.rs index 07898f0088..0037849d1c 100644 --- a/crates/hir_ty/src/utils.rs +++ b/crates/hir_ty/src/utils.rs @@ -1,7 +1,7 @@ //! Helper functions for working with def, which don't need to be a separate //! query, but can't be computed directly from `*Data` (ie, which need a `db`). -use std::{array, iter}; +use std::iter; use base_db::CrateId; use chalk_ir::{fold::Shift, BoundVar, DebruijnIndex}; @@ -25,12 +25,14 @@ use crate::{ }; pub(crate) fn fn_traits(db: &dyn DefDatabase, krate: CrateId) -> impl Iterator<Item = TraitId> { - let fn_traits = [ + [ db.lang_item(krate, "fn".into()), db.lang_item(krate, "fn_mut".into()), db.lang_item(krate, "fn_once".into()), - ]; - array::IntoIter::new(fn_traits).into_iter().flatten().flat_map(|it| it.as_trait()) + ] + .into_iter() + .flatten() + .flat_map(|it| it.as_trait()) } fn direct_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> Vec<TraitId> { |