aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor/src/test_utils.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-08 11:21:29 +0000
committerAleksey Kladov <[email protected]>2019-01-08 11:21:29 +0000
commit96236a9be542be461550083373be3d0cb0bd8406 (patch)
tree82cfc789fcfeea452e6fb729c6af3d7c840be173 /crates/ra_editor/src/test_utils.rs
parent1e0948a509e8f6ec7cbb5e2ef77669325fee0637 (diff)
assist to convert if-let to match
Diffstat (limited to 'crates/ra_editor/src/test_utils.rs')
-rw-r--r--crates/ra_editor/src/test_utils.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_editor/src/test_utils.rs b/crates/ra_editor/src/test_utils.rs
index bf40c92c0..dc2470aa3 100644
--- a/crates/ra_editor/src/test_utils.rs
+++ b/crates/ra_editor/src/test_utils.rs
@@ -13,7 +13,10 @@ pub fn check_action<F: Fn(&SourceFile, TextUnit) -> Option<LocalEdit>>(
13 let result = f(&file, before_cursor_pos).expect("code action is not applicable"); 13 let result = f(&file, before_cursor_pos).expect("code action is not applicable");
14 let actual = result.edit.apply(&before); 14 let actual = result.edit.apply(&before);
15 let actual_cursor_pos = match result.cursor_position { 15 let actual_cursor_pos = match result.cursor_position {
16 None => result.edit.apply_to_offset(before_cursor_pos).unwrap(), 16 None => result
17 .edit
18 .apply_to_offset(before_cursor_pos)
19 .expect("cursor position is affected by the edit"),
17 Some(off) => off, 20 Some(off) => off,
18 }; 21 };
19 let actual = add_cursor(&actual, actual_cursor_pos); 22 let actual = add_cursor(&actual, actual_cursor_pos);