From 9883435e4e7f96a3e33ef3e38665189339db71eb Mon Sep 17 00:00:00 2001 From: Coenen Benjamin Date: Tue, 20 Oct 2020 20:07:39 +0200 Subject: Update crates/assists/src/handlers/replace_string_with_char.rs Co-authored-by: Aleksey Kladov --- crates/assists/src/handlers/replace_string_with_char.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/assists') diff --git a/crates/assists/src/handlers/replace_string_with_char.rs b/crates/assists/src/handlers/replace_string_with_char.rs index 8408e4463..4ca87a8ec 100644 --- a/crates/assists/src/handlers/replace_string_with_char.rs +++ b/crates/assists/src/handlers/replace_string_with_char.rs @@ -26,7 +26,7 @@ pub(crate) fn replace_string_with_char(acc: &mut Assists, ctx: &AssistContext) - let value = token.value()?; let target = token.syntax().text_range(); - if value.is_empty() || value.chars().count() > 1 { + if value.chars().take(2).count() != 1 { return None; } -- cgit v1.2.3