Fix a few clippy::perf warnings

This commit is contained in:
kjeremy 2021-02-16 10:55:34 -05:00
parent cc49502ab4
commit f9bb398cc5
8 changed files with 14 additions and 12 deletions

View file

@ -345,7 +345,7 @@ impl<'a> FindUsages<'a> {
for (file_id, search_range) in search_scope {
let text = sema.db.file_text(file_id);
let search_range =
search_range.unwrap_or(TextRange::up_to(TextSize::of(text.as_str())));
search_range.unwrap_or_else(|| TextRange::up_to(TextSize::of(text.as_str())));
let tree = Lazy::new(|| sema.parse(file_id).syntax().clone());