diff options
author | Lukas Wirth <[email protected]> | 2021-02-28 19:39:43 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-02-28 19:39:43 +0000 |
commit | 0e995adcf690778739fe94fb94ae317d42b4e51b (patch) | |
tree | 5f15802e2bac7e1752d3c3d493ea39bc97ccaec9 /crates/hir/src | |
parent | 2fc137b70f9d455676cc99a1a5c7e6e10c3e7cc2 (diff) |
Turn Ty::Tuple variant into a tuple-variant
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index cdb54eca2..1c31e29ac 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -1547,7 +1547,7 @@ impl Type { | |||
1547 | } | 1547 | } |
1548 | 1548 | ||
1549 | pub fn is_unit(&self) -> bool { | 1549 | pub fn is_unit(&self) -> bool { |
1550 | matches!(self.ty.value, Ty::Tuple { cardinality: 0, .. }) | 1550 | matches!(self.ty.value, Ty::Tuple(0, ..)) |
1551 | } | 1551 | } |
1552 | pub fn is_bool(&self) -> bool { | 1552 | pub fn is_bool(&self) -> bool { |
1553 | matches!(self.ty.value, Ty::Scalar(Scalar::Bool)) | 1553 | matches!(self.ty.value, Ty::Scalar(Scalar::Bool)) |
@@ -1741,7 +1741,7 @@ impl Type { | |||
1741 | } | 1741 | } |
1742 | 1742 | ||
1743 | pub fn tuple_fields(&self, _db: &dyn HirDatabase) -> Vec<Type> { | 1743 | pub fn tuple_fields(&self, _db: &dyn HirDatabase) -> Vec<Type> { |
1744 | if let Ty::Tuple { substs, .. } = &self.ty.value { | 1744 | if let Ty::Tuple(_, substs) = &self.ty.value { |
1745 | substs.iter().map(|ty| self.derived(ty.clone())).collect() | 1745 | substs.iter().map(|ty| self.derived(ty.clone())).collect() |
1746 | } else { | 1746 | } else { |
1747 | Vec::new() | 1747 | Vec::new() |