Skip to content

Commit 01cacbe

Browse files
Merge pull request #20899 from A4-Tacks/ide-comp-test-track
minor: fix track_caller for ide-complpetion test utils
2 parents 30cd10a + 943eba5 commit 01cacbe

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

crates/ide-completion/src/tests.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,10 @@ pub(crate) fn check_edit_with_config(
246246
let (db, position) = position(ra_fixture_before);
247247
let completions: Vec<CompletionItem> =
248248
hir::attach_db(&db, || crate::completions(&db, &config, position, None).unwrap());
249-
let (completion,) = completions
250-
.iter()
251-
.filter(|it| it.lookup() == what)
252-
.collect_tuple()
253-
.unwrap_or_else(|| panic!("can't find {what:?} completion in {completions:#?}"));
249+
let Some((completion,)) = completions.iter().filter(|it| it.lookup() == what).collect_tuple()
250+
else {
251+
panic!("can't find {what:?} completion in {completions:#?}")
252+
};
254253
let mut actual = db.file_text(position.file_id).text(&db).to_string();
255254

256255
let mut combined_edit = completion.text_edit.clone();

0 commit comments

Comments
 (0)