Update crates/assists/src/handlers/replace_string_with_char.rs
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
parent
c22c039578
commit
9883435e4e
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue