From b9c6aa9ec9e491160a6ad7c5ec66151bd67b0ecd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 21:58:36 +0200 Subject: Unify naming of tuple fields --- crates/ra_assists/src/handlers/early_return.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src/handlers') diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs index 3650289fd..69852b611 100644 --- a/crates/ra_assists/src/handlers/early_return.rs +++ b/crates/ra_assists/src/handlers/early_return.rs @@ -51,11 +51,11 @@ pub(crate) fn convert_to_guarded_return(acc: &mut Assists, ctx: &AssistContext) // Check if there is an IfLet that we can handle. let if_let_pat = match cond.pat() { None => None, // No IfLet, supported. - Some(ast::Pat::TupleStructPat(pat)) if pat.args().count() == 1 => { + Some(ast::Pat::TupleStructPat(pat)) if pat.fields().count() == 1 => { let path = pat.path()?; match path.qualifier() { None => { - let bound_ident = pat.args().next().unwrap(); + let bound_ident = pat.fields().next().unwrap(); Some((path, bound_ident)) } Some(_) => return None, -- cgit v1.2.3