Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/db.rs')
| -rw-r--r-- | crates/hir-ty/src/db.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/crates/hir-ty/src/db.rs b/crates/hir-ty/src/db.rs index 73b1183cb2..7e66e938a0 100644 --- a/crates/hir-ty/src/db.rs +++ b/crates/hir-ty/src/db.rs @@ -18,6 +18,7 @@ use hir_def::{ use la_arena::ArenaMap; use salsa::Update; use span::Edition; +use stdx::impl_from; use triomphe::Arc; use crate::{ @@ -488,21 +489,7 @@ pub enum GeneralConstId<'db> { AnonConstId(AnonConstId<'db>), } -impl<'db> From<ConstId> for GeneralConstId<'db> { - fn from(it: ConstId) -> GeneralConstId<'db> { - GeneralConstId::ConstId(it) - } -} -impl<'db> From<StaticId> for GeneralConstId<'db> { - fn from(it: StaticId) -> GeneralConstId<'db> { - GeneralConstId::StaticId(it) - } -} -impl<'db> From<AnonConstId<'db>> for GeneralConstId<'db> { - fn from(it: AnonConstId<'db>) -> GeneralConstId<'db> { - GeneralConstId::AnonConstId(it) - } -} +impl_from!(impl<'db> ConstId, StaticId, AnonConstId<'db> for GeneralConstId<'db>); impl<'db> GeneralConstId<'db> { pub fn generic_def(self, db: &'db dyn HirDatabase) -> Option<GenericDefId> { |