From f9bb398cc50d2cad543cd5d2d135db5574ba3a6c Mon Sep 17 00:00:00 2001 From: kjeremy Date: Tue, 16 Feb 2021 10:55:34 -0500 Subject: Fix a few clippy::perf warnings --- crates/ide_db/src/search.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ide_db/src') diff --git a/crates/ide_db/src/search.rs b/crates/ide_db/src/search.rs index 38b20f2dc..22dd172f7 100644 --- a/crates/ide_db/src/search.rs +++ b/crates/ide_db/src/search.rs @@ -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()); -- cgit v1.2.3