aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/traits
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-05-28 19:46:09 +0100
committerLukas Wirth <[email protected]>2021-05-28 19:46:09 +0100
commita6b92a8cc00c4a4c451e6da2dd4e2a2e8e7bf749 (patch)
tree8eb442f48e85cb17258b44d4339c98c51178bb18 /crates/ide_db/src/traits
parentd5f7b2e52a41a7d3b841f4d0e2225eb703f6a50a (diff)
simplify
Diffstat (limited to 'crates/ide_db/src/traits')
-rw-r--r--crates/ide_db/src/traits/tests.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ide_db/src/traits/tests.rs b/crates/ide_db/src/traits/tests.rs
index 2a5482024..de994407c 100644
--- a/crates/ide_db/src/traits/tests.rs
+++ b/crates/ide_db/src/traits/tests.rs
@@ -2,7 +2,6 @@ use base_db::{fixture::ChangeFixture, FilePosition};
2use expect_test::{expect, Expect}; 2use expect_test::{expect, Expect};
3use hir::Semantics; 3use hir::Semantics;
4use syntax::ast::{self, AstNode}; 4use syntax::ast::{self, AstNode};
5use test_utils::RangeOrOffset;
6 5
7use crate::RootDatabase; 6use crate::RootDatabase;
8 7
@@ -12,10 +11,7 @@ pub(crate) fn position(ra_fixture: &str) -> (RootDatabase, FilePosition) {
12 let mut database = RootDatabase::default(); 11 let mut database = RootDatabase::default();
13 database.apply_change(change_fixture.change); 12 database.apply_change(change_fixture.change);
14 let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)"); 13 let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)");
15 let offset = match range_or_offset { 14 let offset = range_or_offset.expect_offset();
16 RangeOrOffset::Range(_) => panic!(),
17 RangeOrOffset::Offset(it) => it,
18 };
19 (database, FilePosition { file_id, offset }) 15 (database, FilePosition { file_id, offset })
20} 16}
21 17