From b08a1c5f9a8ca7695c2927262dd346801c3374a0 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 22 Oct 2023 14:56:41 -0400 Subject: [PATCH] Fix errors --- src/value/table.rs | 2 +- src/value/value_type.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/value/table.rs b/src/value/table.rs index 2cafaee..727f14d 100644 --- a/src/value/table.rs +++ b/src/value/table.rs @@ -1,4 +1,4 @@ -use crate::{Error, Item, Result, Value, VariableMap}; +use crate::{Error, Result, Value, VariableMap}; use comfy_table::{Cell, Color, ContentArrangement, Table as ComfyTable}; use serde::{Deserialize, Serialize}; use std::{ diff --git a/src/value/value_type.rs b/src/value/value_type.rs index 8363ccd..92d66e8 100644 --- a/src/value/value_type.rs +++ b/src/value/value_type.rs @@ -123,9 +123,17 @@ impl From<&Value> for ValueType { ValueType::Map(value_nodes) } - Value::Table(_table) => ValueType::Table { - column_names: todo!(), - rows: todo!(), + Value::Table(table) => ValueType::Table { + column_names: table + .headers() + .iter() + .map(|column_name| Identifier::new(column_name.clone())) + .collect(), + rows: Box::new(Expression::Value(ValueNode::new( + ValueType::ListExact(Vec::with_capacity(0)), + 0, + 0, + ))), }, Value::Function(function) => ValueType::Function(function.clone()), }