Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/tests.rs')
-rw-r--r--crates/ide-assists/src/tests.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ide-assists/src/tests.rs b/crates/ide-assists/src/tests.rs
index 13e061724e..ef7b09f3c5 100644
--- a/crates/ide-assists/src/tests.rs
+++ b/crates/ide-assists/src/tests.rs
@@ -297,7 +297,9 @@ fn check_with_config(
let assist = match assist_label {
Some(label) => res.into_iter().find(|resolved| resolved.label == label),
- None => res.pop(),
+ None if res.is_empty() => None,
+ // Pick the first as that is the one with the highest priority
+ None => Some(res.swap_remove(0)),
};
match (assist, expected) {