aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db/src/search.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_db/src/search.rs')
-rw-r--r--crates/ra_ide_db/src/search.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs
index 599b8e562..596f957b8 100644
--- a/crates/ra_ide_db/src/search.rs
+++ b/crates/ra_ide_db/src/search.rs
@@ -4,7 +4,7 @@
4//! get a super-set of matches. Then, we we confirm each match using precise 4//! get a super-set of matches. Then, we we confirm each match using precise
5//! name resolution. 5//! name resolution.
6 6
7use std::mem; 7use std::{convert::TryInto, mem};
8 8
9use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; 9use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility};
10use once_cell::unsync::Lazy; 10use once_cell::unsync::Lazy;
@@ -207,7 +207,7 @@ impl Definition {
207 let tree = Lazy::new(|| sema.parse(file_id).syntax().clone()); 207 let tree = Lazy::new(|| sema.parse(file_id).syntax().clone());
208 208
209 for (idx, _) in text.match_indices(pat) { 209 for (idx, _) in text.match_indices(pat) {
210 let offset = TextSize::from_usize(idx); 210 let offset: TextSize = idx.try_into().unwrap();
211 if !search_range.contains_inclusive(offset) { 211 if !search_range.contains_inclusive(offset) {
212 tested_by!(search_filters_by_range; force); 212 tested_by!(search_filters_by_range; force);
213 continue; 213 continue;