diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-09 12:37:49 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-09 12:37:49 +0000 |
commit | 9d786ea221b27fbdf7c7f7beea0290db448e0611 (patch) | |
tree | 312ae071afe742011c1e396d63123729e31f9815 /crates/ra_hir/src/code_model.rs | |
parent | defc7ad772123a449f7cc384dd46d88c3a45fb53 (diff) | |
parent | 6294fd5ec9c6946bdd91f1274956c573f9f2a136 (diff) |
Merge #2198
2198: Unfork struct and union ids r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9d0db8024..e5bfad3ca 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -288,7 +288,7 @@ pub struct Struct { | |||
288 | 288 | ||
289 | impl Struct { | 289 | impl Struct { |
290 | pub fn module(self, db: &impl DefDatabase) -> Module { | 290 | pub fn module(self, db: &impl DefDatabase) -> Module { |
291 | Module { id: self.id.module(db) } | 291 | Module { id: self.id.0.module(db) } |
292 | } | 292 | } |
293 | 293 | ||
294 | pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> { | 294 | pub fn krate(self, db: &impl DefDatabase) -> Option<Crate> { |
@@ -296,11 +296,11 @@ impl Struct { | |||
296 | } | 296 | } |
297 | 297 | ||
298 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { | 298 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { |
299 | db.struct_data(self.id).name.clone() | 299 | db.struct_data(self.id.into()).name.clone() |
300 | } | 300 | } |
301 | 301 | ||
302 | pub fn fields(self, db: &impl HirDatabase) -> Vec<StructField> { | 302 | pub fn fields(self, db: &impl HirDatabase) -> Vec<StructField> { |
303 | db.struct_data(self.id) | 303 | db.struct_data(self.id.into()) |
304 | .variant_data | 304 | .variant_data |
305 | .fields() | 305 | .fields() |
306 | .into_iter() | 306 | .into_iter() |
@@ -310,7 +310,7 @@ impl Struct { | |||
310 | } | 310 | } |
311 | 311 | ||
312 | pub fn field(self, db: &impl HirDatabase, name: &Name) -> Option<StructField> { | 312 | pub fn field(self, db: &impl HirDatabase, name: &Name) -> Option<StructField> { |
313 | db.struct_data(self.id) | 313 | db.struct_data(self.id.into()) |
314 | .variant_data | 314 | .variant_data |
315 | .fields() | 315 | .fields() |
316 | .into_iter() | 316 | .into_iter() |
@@ -346,11 +346,11 @@ pub struct Union { | |||
346 | 346 | ||
347 | impl Union { | 347 | impl Union { |
348 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { | 348 | pub fn name(self, db: &impl DefDatabase) -> Option<Name> { |
349 | db.union_data(self.id).name.clone() | 349 | db.struct_data(self.id.into()).name.clone() |
350 | } | 350 | } |
351 | 351 | ||
352 | pub fn module(self, db: &impl HirDatabase) -> Module { | 352 | pub fn module(self, db: &impl HirDatabase) -> Module { |
353 | Module { id: self.id.module(db) } | 353 | Module { id: self.id.0.module(db) } |
354 | } | 354 | } |
355 | 355 | ||
356 | pub fn ty(self, db: &impl HirDatabase) -> Ty { | 356 | pub fn ty(self, db: &impl HirDatabase) -> Ty { |