From 4a0821f332a2c2bf05496a20e1a4dc4b3eb863cc Mon Sep 17 00:00:00 2001 From: weirane Date: Wed, 18 May 2022 02:38:50 +0800 Subject: [PATCH] Simplify const reference check Co-authored-by: Lukas Wirth --- crates/ide-assists/src/handlers/convert_let_else_to_match.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ide-assists/src/handlers/convert_let_else_to_match.rs b/crates/ide-assists/src/handlers/convert_let_else_to_match.rs index 5498afddd9..2363aa7cbd 100644 --- a/crates/ide-assists/src/handlers/convert_let_else_to_match.rs +++ b/crates/ide-assists/src/handlers/convert_let_else_to_match.rs @@ -17,7 +17,7 @@ fn binders_in_pat( let ident = p.name()?; let ismut = p.ref_token().is_none() && p.mut_token().is_some(); // check for const reference - if !(p.is_simple_ident() && sem.resolve_bind_pat_to_const(p).is_some()) { + if sem.resolve_bind_pat_to_const(p).is_none() { acc.push((ident, ismut)); } if let Some(inner) = p.pat() {