diff --git a/src/worktable.rs b/src/worktable.rs index b84dd2e..7e4d37a 100644 --- a/src/worktable.rs +++ b/src/worktable.rs @@ -522,7 +522,12 @@ impl WorkTable { } //noinspection RsConstantConditionIf pub fn add_field(&mut self, _field: T) { - self.add_column(T::NAME, ::into_column()); + let name = T::NAME.to_string(); + let index = self.column_names.len(); + assert_eq!(index, T::INDEX, "Field index mismatch"); + self.columns_map.insert(name.clone(), index as _); + self.column_names.push(name); + self.column_values.push(T::Type::into_column()); if T::PRIMARY { self.set_primary();