Skip to content

Commit

Permalink
deps: update tabled
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Sep 24, 2024
1 parent cd3899f commit f6f3fe3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
17 changes: 8 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
10 changes: 4 additions & 6 deletions tests-integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<chrono::Local>;
pub fn now() -> DateTime {
Expand All @@ -24,9 +24,7 @@ pub fn now() -> DateTime {

/// 转成表格来打印
pub fn to_table<T: Tabled, I: IntoIterator<Item = T>>(into_iter: I) -> String {
Table::new(into_iter)
.with(tabled::Style::psql())
.to_string()
Table::new(into_iter).with(Style::psql()).to_string()
}

/// 转成表格来打印,并自定义表头
Expand All @@ -36,6 +34,6 @@ where
I: IntoIterator<Item = T>,
{
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()
}
1 change: 0 additions & 1 deletion tests-integration/tests/stocklist.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(once_cell)]
use rustdx_cmd::{eastmoney, fetch_code};
use std::{collections::HashSet, sync::LazyLock};
use tests_integration::snap;
Expand Down

0 comments on commit f6f3fe3

Please sign in to comment.