diff options
author | HampusM <hampus@hampusmat.com> | 2025-03-29 16:39:22 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-03-29 16:39:22 +0100 |
commit | af42d53f0f6f15da05488bf97b0989691259dcce (patch) | |
tree | ea8e4580bf4d00b851ad978f5c1f6389a1eba7eb | |
parent | 026a6e129ee486cd17fb17289bd3be250b7efa1c (diff) |
feat: check field types in push fn
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); } |