Skip to content

Commit 9883435

Browse files
bnjjjmatklad
andauthored
Update crates/assists/src/handlers/replace_string_with_char.rs
Co-authored-by: Aleksey Kladov <[email protected]>
1 parent c22c039 commit 9883435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/assists/src/handlers/replace_string_with_char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) fn replace_string_with_char(acc: &mut Assists, ctx: &AssistContext) -
2626
let value = token.value()?;
2727
let target = token.syntax().text_range();
2828

29-
if value.is_empty() || value.chars().count() > 1 {
29+
if value.chars().take(2).count() != 1 {
3030
return None;
3131
}
3232

0 commit comments

Comments
 (0)