mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Fix a few clippy::perf warnings
This commit is contained in:
parent
cc49502ab4
commit
f9bb398cc5
8 changed files with 14 additions and 12 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue