aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/doc_tests.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-01-11 22:40:36 +0000
committerKirill Bulatov <[email protected]>2020-01-15 18:17:17 +0000
commit78a21253b494e573885ac8336bff6e93b401046f (patch)
tree3ec31f8481f9a930b0b3afb6cc0ce4c97cf648f2 /crates/ra_assists/src/doc_tests.rs
parent73dc8b6f06b49f4728a50e83781c361e9a8b3100 (diff)
Apply the api design suggestions
Diffstat (limited to 'crates/ra_assists/src/doc_tests.rs')
-rw-r--r--crates/ra_assists/src/doc_tests.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_assists/src/doc_tests.rs b/crates/ra_assists/src/doc_tests.rs
index 21bee228d..5dc1ee233 100644
--- a/crates/ra_assists/src/doc_tests.rs
+++ b/crates/ra_assists/src/doc_tests.rs
@@ -15,21 +15,21 @@ fn check(assist_id: &str, before: &str, after: &str) {
15 let (db, file_id) = TestDB::with_single_file(&before); 15 let (db, file_id) = TestDB::with_single_file(&before);
16 let frange = FileRange { file_id, range: selection.into() }; 16 let frange = FileRange { file_id, range: selection.into() };
17 17
18 let (_assist_id, action, _) = crate::assists(&db, frange) 18 let assist = crate::assists(&db, frange)
19 .into_iter() 19 .into_iter()
20 .find(|(id, _, _)| id.id.0 == assist_id) 20 .find(|assist| assist.label.id.0 == assist_id)
21 .unwrap_or_else(|| { 21 .unwrap_or_else(|| {
22 panic!( 22 panic!(
23 "\n\nAssist is not applicable: {}\nAvailable assists: {}", 23 "\n\nAssist is not applicable: {}\nAvailable assists: {}",
24 assist_id, 24 assist_id,
25 crate::assists(&db, frange) 25 crate::assists(&db, frange)
26 .into_iter() 26 .into_iter()
27 .map(|(id, _, _)| id.id.0) 27 .map(|assist| assist.label.id.0)
28 .collect::<Vec<_>>() 28 .collect::<Vec<_>>()
29 .join(", ") 29 .join(", ")
30 ) 30 )
31 }); 31 });
32 32
33 let actual = action.edit.apply(&before); 33 let actual = assist.get_first_action().edit.apply(&before);
34 assert_eq_text!(after, &actual); 34 assert_eq_text!(after, &actual);
35} 35}