Fix clippy::or_fun_call
This commit is contained in:
@@ -10,7 +10,7 @@ pub(super) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) {
|
||||
let names = ctx.analyzer.all_names(ctx.db);
|
||||
for (name, res) in names.into_iter() {
|
||||
let r = res.as_ref();
|
||||
let def = match r.take_types().or(r.take_values()) {
|
||||
let def = match r.take_types().or_else(|| r.take_values()) {
|
||||
Some(hir::Resolution::Def(def)) => def,
|
||||
_ => continue,
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user