mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Fix clippy::or_fun_call
This commit is contained in:
parent
40424d4222
commit
b28ca32db2
12 changed files with 29 additions and 26 deletions
|
@ -95,7 +95,7 @@ fn extend_single_word_in_comment_or_string(
|
|||
}
|
||||
|
||||
let start_idx = before.rfind(non_word_char)? as u32;
|
||||
let end_idx = after.find(non_word_char).unwrap_or(after.len()) as u32;
|
||||
let end_idx = after.find(non_word_char).unwrap_or_else(|| after.len()) as u32;
|
||||
|
||||
let from: TextUnit = (start_idx + 1).into();
|
||||
let to: TextUnit = (cursor_position + end_idx).into();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue