diff --git a/src/nu/value.rs b/src/nu/value.rs index 11dc4df..411259d 100644 --- a/src/nu/value.rs +++ b/src/nu/value.rs @@ -12,7 +12,7 @@ pub(crate) enum Table { RowIncompatibleLen(usize, usize, usize), RowIncompatibleType(usize, String, Type, Type), RowInvalidKey(usize, String, Vec), - IsTable, + IsValid, NotAList, } @@ -145,7 +145,7 @@ pub(crate) fn is_table(value: &Value) -> Table { } } - Table::IsTable + Table::IsValid } _ => Table::NotAList, } @@ -180,7 +180,7 @@ pub(crate) fn is_table(value: &Value) -> Table { /// } /// ``` pub(crate) fn transpose(value: &Value) -> Value { - if matches!(is_table(value), Table::IsTable) { + if matches!(is_table(value), Table::IsValid) { let value_rows = match value { Value::List { vals, .. } => vals, _ => return value.clone(), @@ -434,7 +434,7 @@ mod tests { ]); assert_eq!( is_table(&table), - Table::IsTable, + Table::IsValid, "{} should be a table", default_value_repr(&table) ); @@ -451,7 +451,7 @@ mod tests { ]); assert_eq!( is_table(&table_with_out_of_order_columns), - Table::IsTable, + Table::IsValid, "{} should be a table", default_value_repr(&table_with_out_of_order_columns) ); @@ -468,7 +468,7 @@ mod tests { ]); assert_eq!( is_table(&table_with_nulls), - Table::IsTable, + Table::IsValid, "{} should be a table", default_value_repr(&table_with_nulls) ); @@ -485,7 +485,7 @@ mod tests { ]); assert_eq!( is_table(&table_with_number_colum), - Table::IsTable, + Table::IsValid, "{} should be a table", default_value_repr(&table_with_number_colum) ); diff --git a/src/ui.rs b/src/ui.rs index ea2ee10..5cd2048 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -250,7 +250,7 @@ fn render_data(frame: &mut Frame<'_, B>, app: &App, config: &Config) }); let table_type = is_table(&value); - let is_a_table = matches!(table_type, crate::nu::value::Table::IsTable); + let is_a_table = matches!(table_type, crate::nu::value::Table::IsValid); let mut data_frame_height = if config.show_cell_path { frame.size().height - 2 @@ -276,7 +276,7 @@ fn render_data(frame: &mut Frame<'_, B>, app: &App, config: &Config) i, k, ks )), crate::nu::value::Table::NotAList => None, - crate::nu::value::Table::IsTable => unreachable!(), + crate::nu::value::Table::IsValid => unreachable!(), }; if let Some(msg) = msg {