diff options
author | Zac Pullar-Strecker <[email protected]> | 2020-07-11 00:23:33 +0100 |
---|---|---|
committer | Zac Pullar-Strecker <[email protected]> | 2020-07-11 00:23:33 +0100 |
commit | 73ff610e41959e3e7c78a2b4b25b086883132956 (patch) | |
tree | ececc181c9e62ef31f3f5751180ace77c76880e9 /crates/ra_hir/src | |
parent | d6f9e8806a26c5998a691974ba8e3655a2186766 (diff) |
Use From instead of Into in resolver method
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 56b2481e6..8c5e1b746 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -203,18 +203,18 @@ impl ModuleDef { | |||
203 | 203 | ||
204 | pub fn resolver<D: DefDatabase + HirDatabase>(&self, db: &D) -> Option<Resolver> { | 204 | pub fn resolver<D: DefDatabase + HirDatabase>(&self, db: &D) -> Option<Resolver> { |
205 | Some(match self { | 205 | Some(match self { |
206 | ModuleDef::Module(m) => Into::<ModuleId>::into(m.clone()).resolver(db), | 206 | ModuleDef::Module(m) => ModuleId::from(m.clone()).resolver(db), |
207 | ModuleDef::Function(f) => Into::<FunctionId>::into(f.clone()).resolver(db), | 207 | ModuleDef::Function(f) => FunctionId::from(f.clone()).resolver(db), |
208 | ModuleDef::Adt(adt) => Into::<AdtId>::into(adt.clone()).resolver(db), | 208 | ModuleDef::Adt(adt) => AdtId::from(adt.clone()).resolver(db), |
209 | ModuleDef::EnumVariant(ev) => { | 209 | ModuleDef::EnumVariant(ev) => { |
210 | Into::<GenericDefId>::into(Into::<GenericDef>::into(ev.clone())).resolver(db) | 210 | GenericDefId::from(GenericDef::from(ev.clone())).resolver(db) |
211 | } | 211 | } |
212 | ModuleDef::Const(c) => { | 212 | ModuleDef::Const(c) => { |
213 | Into::<GenericDefId>::into(Into::<GenericDef>::into(c.clone())).resolver(db) | 213 | GenericDefId::from(GenericDef::from(c.clone())).resolver(db) |
214 | } | 214 | } |
215 | ModuleDef::Static(s) => Into::<StaticId>::into(s.clone()).resolver(db), | 215 | ModuleDef::Static(s) => StaticId::from(s.clone()).resolver(db), |
216 | ModuleDef::Trait(t) => Into::<TraitId>::into(t.clone()).resolver(db), | 216 | ModuleDef::Trait(t) => TraitId::from(t.clone()).resolver(db), |
217 | ModuleDef::TypeAlias(t) => Into::<ModuleId>::into(t.module(db)).resolver(db), | 217 | ModuleDef::TypeAlias(t) => ModuleId::from(t.module(db)).resolver(db), |
218 | // FIXME: This should be a resolver relative to `std/core` | 218 | // FIXME: This should be a resolver relative to `std/core` |
219 | ModuleDef::BuiltinType(_t) => None?, | 219 | ModuleDef::BuiltinType(_t) => None?, |
220 | }) | 220 | }) |