From d06733efebc5d8b378398f1cbb4bbd9f3deb8270 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Wed, 19 Feb 2020 13:29:34 +0900 Subject: Cleanup --- crates/ra_ide/src/completion/presentation.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates/ra_ide/src/completion') diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index 1a3bcffae..a524987fd 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs @@ -135,11 +135,7 @@ impl Completions { let (before, after) = (&docs[..idx], &docs[idx + s.len()..]); // Ensure to match the full word if after.starts_with('!') - && before - .chars() - .rev() - .next() - .map_or(true, |c| c != '_' && !c.is_ascii_alphanumeric()) + && !before.ends_with(|c: char| c == '_' || c.is_ascii_alphanumeric()) { // It may have spaces before the braces like `foo! {}` match after[1..].chars().find(|&c| !c.is_whitespace()) { -- cgit v1.2.3