From f6f3fe3e6ab555281cbdab6899c066824a429d4e Mon Sep 17 00:00:00 2001 From: zjp Date: Tue, 24 Sep 2024 13:57:51 +0800 Subject: [PATCH] deps: update tabled --- Cargo.lock | 17 ++++++++--------- tests-integration/Cargo.toml | 2 +- tests-integration/src/lib.rs | 10 ++++------ tests-integration/tests/stocklist.rs | 1 - 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2bc040c..0f4dd05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -553,9 +553,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "papergrid" -version = "0.7.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1526bb6aa9f10ec339fb10360f22c57edf81d5678d0278e93bc12a47ffbe4b01" +checksum = "c7419ad52a7de9b60d33e11085a0fe3df1fbd5926aa3f93d3dd53afbc9e86725" dependencies = [ "bytecount", "fnv", @@ -829,20 +829,19 @@ dependencies = [ [[package]] name = "tabled" -version = "0.10.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c3ee73732ffceaea7b8f6b719ce3bb17f253fa27461ffeaf568ebd0cdb4b85" +checksum = "77c9303ee60b9bedf722012ea29ae3711ba13a67c9b9ae28993838b63057cb1b" dependencies = [ "papergrid", "tabled_derive", - "unicode-width", ] [[package]] name = "tabled_derive" -version = "0.5.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beca1b4eaceb4f2755df858b88d9b9315b7ccfd1ffd0d7a48a52602301f01a57" +checksum = "bf0fb8bfdc709786c154e24a66777493fb63ae97e3036d914c8666774c477069" dependencies = [ "heck", "proc-macro-error", @@ -937,9 +936,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "untrusted" diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index e8a389d..af0efb3 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -tabled = "0.10" +tabled = "0.16" insta = "1" rustdx = { path = "../" } rustdx-cmd = { path = "../rustdx-cmd" } diff --git a/tests-integration/src/lib.rs b/tests-integration/src/lib.rs index f2257ae..7db1e3f 100644 --- a/tests-integration/src/lib.rs +++ b/tests-integration/src/lib.rs @@ -15,7 +15,7 @@ mod east; mod fetch_code; pub use insta::{assert_debug_snapshot as snap, assert_snapshot as shot}; -use tabled::{Table, Tabled}; +use tabled::{settings::Style, Table, Tabled}; pub type DateTime = chrono::DateTime; pub fn now() -> DateTime { @@ -24,9 +24,7 @@ pub fn now() -> DateTime { /// 转成表格来打印 pub fn to_table>(into_iter: I) -> String { - Table::new(into_iter) - .with(tabled::Style::psql()) - .to_string() + Table::new(into_iter).with(Style::psql()).to_string() } /// 转成表格来打印,并自定义表头 @@ -36,6 +34,6 @@ where I: IntoIterator, { let mut builder = Table::builder(into_iter); - builder.set_columns(headers.iter().copied()); - builder.build().with(tabled::Style::psql()).to_string() + builder.push_column(headers.iter().copied()); + builder.build().with(Style::psql()).to_string() } diff --git a/tests-integration/tests/stocklist.rs b/tests-integration/tests/stocklist.rs index ed1ef3f..29f85c7 100644 --- a/tests-integration/tests/stocklist.rs +++ b/tests-integration/tests/stocklist.rs @@ -1,4 +1,3 @@ -#![feature(once_cell)] use rustdx_cmd::{eastmoney, fetch_code}; use std::{collections::HashSet, sync::LazyLock}; use tests_integration::snap;