Skip to content

Commit 9b5b558

Browse files
Merge pull request rust-lang#20899 from A4-Tacks/ide-comp-test-track
minor: fix track_caller for ide-complpetion test utils
2 parents a1df998 + 1a8055d commit 9b5b558

File tree

1 file changed

+4
-5
lines changed
  • src/tools/rust-analyzer/crates/ide-completion/src

1 file changed

+4
-5
lines changed

src/tools/rust-analyzer/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)