Function
lower_variant
(types: impl Iterator<Item = Option<&'a Type>>, vec: &mut Vec<CoreType>)
Source from the content-addressed store, hash-verified
| 651 | } |
| 652 | |
| 653 | fn lower_variant<'a>(types: impl Iterator<Item = Option<&'a Type>>, vec: &mut Vec<CoreType>) { |
| 654 | vec.push(CoreType::I32); |
| 655 | let offset = vec.len(); |
| 656 | for ty in types { |
| 657 | let ty = match ty { |
| 658 | Some(ty) => ty, |
| 659 | None => continue, |
| 660 | }; |
| 661 | for (index, ty) in ty.lowered().iter().enumerate() { |
| 662 | let index = offset + index; |
| 663 | if index < vec.len() { |
| 664 | vec[index] = vec[index].join(*ty); |
| 665 | } else { |
| 666 | vec.push(*ty) |
| 667 | } |
| 668 | } |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | fn u32_count_from_flag_count(count: usize) -> usize { |
| 673 | match FlagsSize::from_count(count) { |
Tested by
no test coverage detected