diff options
author | Aleksey Kladov <[email protected]> | 2020-04-24 23:57:47 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-25 10:59:18 +0100 |
commit | 63a462f37ca584e1a585a69e30823ce25d4d252f (patch) | |
tree | 005ab4d5b50f7d031be9f4056bd1fccd68473587 /crates/ra_ide_db/src/search.rs | |
parent | dc2151085e9b117bc87307bf47edf3d17a170b49 (diff) |
Switch to TryFrom
Diffstat (limited to 'crates/ra_ide_db/src/search.rs')
-rw-r--r-- | crates/ra_ide_db/src/search.rs | 4 |
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 | ||
7 | use std::mem; | 7 | use std::{convert::TryInto, mem}; |
8 | 8 | ||
9 | use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; | 9 | use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; |
10 | use once_cell::unsync::Lazy; | 10 | use 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; |