use VecSet in IntroducedVariables

This commit is contained in:
Folkert 2022-04-17 20:43:45 +02:00
parent 9f453a7ba2
commit 7f3ca4458a
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 25 additions and 17 deletions

View file

@ -344,7 +344,8 @@ pub fn canonicalize_defs<'a>(
let mut named = can_ann.introduced_variables.named;
for loc_lowercase in vars.iter() {
match named.iter().position(|nv| nv.name == loc_lowercase.value) {
let opt_index = named.iter().position(|nv| nv.name == loc_lowercase.value);
match opt_index {
Some(index) => {
// This is a valid lowercase rigid var for the type def.
let named_variable = named.swap_remove(index);