aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/node_ext.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/node_ext.rs')
-rw-r--r--crates/ra_syntax/src/ast/node_ext.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs
index 69726fb93..4b4a72375 100644
--- a/crates/ra_syntax/src/ast/node_ext.rs
+++ b/crates/ra_syntax/src/ast/node_ext.rs
@@ -227,13 +227,13 @@ impl fmt::Display for NameOrNameRef {
227 } 227 }
228} 228}
229 229
230impl ast::RecordFieldPat { 230impl ast::RecordPatField {
231 /// Deals with field init shorthand 231 /// Deals with field init shorthand
232 pub fn field_name(&self) -> Option<NameOrNameRef> { 232 pub fn field_name(&self) -> Option<NameOrNameRef> {
233 if let Some(name_ref) = self.name_ref() { 233 if let Some(name_ref) = self.name_ref() {
234 return Some(NameOrNameRef::NameRef(name_ref)); 234 return Some(NameOrNameRef::NameRef(name_ref));
235 } 235 }
236 if let Some(ast::Pat::BindPat(pat)) = self.pat() { 236 if let Some(ast::Pat::IdentPat(pat)) = self.pat() {
237 let name = pat.name()?; 237 let name = pat.name()?;
238 return Some(NameOrNameRef::Name(name)); 238 return Some(NameOrNameRef::Name(name));
239 } 239 }
@@ -294,13 +294,13 @@ impl ast::SlicePat {
294 let prefix = args 294 let prefix = args
295 .peeking_take_while(|p| match p { 295 .peeking_take_while(|p| match p {
296 ast::Pat::DotDotPat(_) => false, 296 ast::Pat::DotDotPat(_) => false,
297 ast::Pat::BindPat(bp) => match bp.pat() { 297 ast::Pat::IdentPat(bp) => match bp.pat() {
298 Some(ast::Pat::DotDotPat(_)) => false, 298 Some(ast::Pat::DotDotPat(_)) => false,
299 _ => true, 299 _ => true,
300 }, 300 },
301 ast::Pat::RefPat(rp) => match rp.pat() { 301 ast::Pat::RefPat(rp) => match rp.pat() {
302 Some(ast::Pat::DotDotPat(_)) => false, 302 Some(ast::Pat::DotDotPat(_)) => false,
303 Some(ast::Pat::BindPat(bp)) => match bp.pat() { 303 Some(ast::Pat::IdentPat(bp)) => match bp.pat() {
304 Some(ast::Pat::DotDotPat(_)) => false, 304 Some(ast::Pat::DotDotPat(_)) => false,
305 _ => true, 305 _ => true,
306 }, 306 },