do what clippy wants

This commit is contained in:
Folkert 2020-03-09 23:51:48 +01:00
parent 2bad39e8b9
commit 5237408b15
4 changed files with 7 additions and 8 deletions

View file

@ -265,12 +265,10 @@ fn layout_from_flat_type<'a>(
}
} else {
// up to 256 enum tags can be stored in a byte
let mut counter = 0u8;
let mut tag_to_u8 = MutMap::default();
for (name, _) in tags {
tag_to_u8.insert(name, counter);
counter += 1;
for (counter, (name, _)) in tags.into_iter().enumerate() {
tag_to_u8.insert(name, counter as u8);
}
Ok(Layout::Builtin(Builtin::Byte(tag_to_u8)))
}