mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 08:38:34 +02:00
Rust 1.85, edition=2024 (#15741)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
authors = ["The Nushell Project Developers"]
|
||||
description = "Nushell table printing"
|
||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-table"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
name = "nu-table"
|
||||
version = "0.104.1"
|
||||
@ -23,4 +23,4 @@ fancy-regex = { workspace = true }
|
||||
tabled = { workspace = true, features = ["ansi"], default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
# nu-test-support = { path="../nu-test-support", version = "0.104.1" }
|
||||
# nu-test-support = { path="../nu-test-support", version = "0.104.1" }
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::{clean_charset, colorize_space_str, string_wrap, TableOutput, TableTheme};
|
||||
use crate::{TableOutput, TableTheme, clean_charset, colorize_space_str, string_wrap};
|
||||
use nu_color_config::{Alignment, StyleComputer, TextStyle};
|
||||
use nu_protocol::{Config, FooterMode, ShellError, Span, TableMode, TrimStrategy, Value};
|
||||
use nu_utils::terminal_size;
|
||||
|
@ -10,6 +10,7 @@ use nu_color_config::TextStyle;
|
||||
use nu_protocol::{TableIndent, TrimStrategy};
|
||||
|
||||
use tabled::{
|
||||
Table,
|
||||
builder::Builder,
|
||||
grid::{
|
||||
ansi::ANSIBuf,
|
||||
@ -19,18 +20,17 @@ use tabled::{
|
||||
},
|
||||
dimension::{CompleteDimensionVecRecords, SpannedGridDimension},
|
||||
records::{
|
||||
vec_records::{Cell, Text, VecRecords},
|
||||
IntoRecords, IterRecords, Records,
|
||||
vec_records::{Cell, Text, VecRecords},
|
||||
},
|
||||
},
|
||||
settings::{
|
||||
Alignment, CellOption, Color, Padding, TableOption, Width,
|
||||
formatting::AlignmentStrategy,
|
||||
object::{Columns, Rows},
|
||||
themes::ColumnNames,
|
||||
width::Truncate,
|
||||
Alignment, CellOption, Color, Padding, TableOption, Width,
|
||||
},
|
||||
Table,
|
||||
};
|
||||
|
||||
use crate::{convert_style, is_color_empty, table_theme::TableTheme};
|
||||
|
@ -4,8 +4,8 @@ use nu_protocol::{Config, Value};
|
||||
use nu_utils::SharedCow;
|
||||
|
||||
use crate::{
|
||||
common::{get_index_style, load_theme, nu_value_to_string_clean},
|
||||
StringResult, TableOpts, UnstructuredTable,
|
||||
common::{get_index_style, load_theme, nu_value_to_string_clean},
|
||||
};
|
||||
|
||||
pub struct CollapsedTable;
|
||||
@ -36,7 +36,7 @@ fn colorize_value(value: &mut Value, config: &Config, style_computer: &StyleComp
|
||||
// todo: Remove recursion?
|
||||
|
||||
match value {
|
||||
Value::Record { ref mut val, .. } => {
|
||||
Value::Record { val, .. } => {
|
||||
let style = get_index_style(style_computer);
|
||||
// Take ownership of the record and reassign to &mut
|
||||
// We do this to have owned keys through `.into_iter`
|
||||
|
@ -5,14 +5,14 @@ use nu_engine::column::get_columns;
|
||||
use nu_protocol::{Config, Record, ShellError, Span, Value};
|
||||
|
||||
use crate::{
|
||||
NuTable, TableOpts, TableOutput,
|
||||
common::{
|
||||
check_value, configure_table, error_sign, get_header_style, get_index_style, load_theme,
|
||||
nu_value_to_string, nu_value_to_string_clean, nu_value_to_string_colored, wrap_text,
|
||||
NuText, StringResult, TableResult, INDEX_COLUMN_NAME,
|
||||
INDEX_COLUMN_NAME, NuText, StringResult, TableResult, check_value, configure_table,
|
||||
error_sign, get_header_style, get_index_style, load_theme, nu_value_to_string,
|
||||
nu_value_to_string_clean, nu_value_to_string_colored, wrap_text,
|
||||
},
|
||||
string_width,
|
||||
types::has_index,
|
||||
NuTable, TableOpts, TableOutput,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -3,13 +3,13 @@ use nu_engine::column::get_columns;
|
||||
use nu_protocol::{Config, Record, ShellError, Value};
|
||||
|
||||
use crate::{
|
||||
clean_charset, colorize_space,
|
||||
NuRecordsValue, NuTable, StringResult, TableOpts, TableOutput, TableResult, clean_charset,
|
||||
colorize_space,
|
||||
common::{
|
||||
check_value, configure_table, get_empty_style, get_header_style, get_index_style,
|
||||
get_value_style, nu_value_to_string_colored, NuText, INDEX_COLUMN_NAME,
|
||||
INDEX_COLUMN_NAME, NuText, check_value, configure_table, get_empty_style, get_header_style,
|
||||
get_index_style, get_value_style, nu_value_to_string_colored,
|
||||
},
|
||||
types::has_index,
|
||||
NuRecordsValue, NuTable, StringResult, TableOpts, TableOutput, TableResult,
|
||||
};
|
||||
|
||||
pub struct JustTable;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use nu_color_config::StyleComputer;
|
||||
use nu_protocol::{Config, Signals, Span, TableIndexMode, TableMode};
|
||||
|
||||
use crate::{common::INDEX_COLUMN_NAME, NuTable};
|
||||
use crate::{NuTable, common::INDEX_COLUMN_NAME};
|
||||
|
||||
mod collapse;
|
||||
mod expanded;
|
||||
|
@ -11,7 +11,7 @@ use tabled::{
|
||||
tables::{PoolTable, TableValue},
|
||||
};
|
||||
|
||||
use crate::{is_color_empty, string_width, string_wrap, TableTheme};
|
||||
use crate::{TableTheme, is_color_empty, string_width, string_wrap};
|
||||
|
||||
/// UnstructuredTable has a recursive table representation of nu_protocol::Value.
|
||||
///
|
||||
|
@ -7,8 +7,8 @@ use tabled::{
|
||||
util::string::get_text_width,
|
||||
},
|
||||
settings::{
|
||||
width::{Truncate, Wrap},
|
||||
Color,
|
||||
width::{Truncate, Wrap},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use nu_protocol::TrimStrategy;
|
||||
use nu_table::{string_width, NuTable, TableTheme};
|
||||
use nu_table::{NuTable, TableTheme, string_width};
|
||||
use tabled::grid::records::vec_records::Text;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
mod common;
|
||||
|
||||
use common::{create_row, create_table, TestCase};
|
||||
use common::{TestCase, create_row, create_table};
|
||||
|
||||
use nu_table::TableTheme as theme;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
mod common;
|
||||
|
||||
use common::{create_row as row, TestCase};
|
||||
use common::{TestCase, create_row as row};
|
||||
use nu_table::{NuTable, TableTheme as theme};
|
||||
use tabled::grid::records::vec_records::Text;
|
||||
|
||||
|
Reference in New Issue
Block a user