diff options
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r-- | crates/ra_hir_expand/src/name.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs index e62693b68..b3fa1efba 100644 --- a/crates/ra_hir_expand/src/name.rs +++ b/crates/ra_hir_expand/src/name.rs | |||
@@ -93,7 +93,10 @@ impl AsName for ast::FieldKind { | |||
93 | fn as_name(&self) -> Name { | 93 | fn as_name(&self) -> Name { |
94 | match self { | 94 | match self { |
95 | ast::FieldKind::Name(nr) => nr.as_name(), | 95 | ast::FieldKind::Name(nr) => nr.as_name(), |
96 | ast::FieldKind::Index(idx) => Name::new_tuple_field(idx.text().parse().unwrap()), | 96 | ast::FieldKind::Index(idx) => { |
97 | let idx = idx.text().parse::<usize>().unwrap_or(0); | ||
98 | Name::new_tuple_field(idx) | ||
99 | } | ||
97 | } | 100 | } |
98 | } | 101 | } |
99 | } | 102 | } |