Update crates/assists/src/handlers/replace_string_with_char.rs

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
Coenen Benjamin 2020-10-20 20:07:39 +02:00 committed by GitHub
parent c22c039578
commit 9883435e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}