From af42d53f0f6f15da05488bf97b0989691259dcce Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 29 Mar 2025 16:39:22 +0100 Subject: feat: check field types in push fn --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 25f9ab5..885f364 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -170,6 +170,14 @@ impl MultiVec if self.capacity != 0 { assert_eq!(fields.as_ref().len(), self.field_cnt()); + assert!(fields + .as_ref() + .iter() + .zip(self.get_field_metadata().unwrap()) + .all(|(item_field, field_metadata)| { + item_field.id() == field_metadata.type_id + })); + if self.capacity == self.length { self.grow_amortized(1, &fields); } -- cgit v1.2.3-18-g5258