History

remove tabled

Benedikt Mandelkow committed 2 years ago

Commit fcd585b1 parent 5fc379d3 files · +39 −171Browse files

Unified · Split

3 files
  1. Cargo.lock +1 −133
  2. Cargo.toml +0 −1
  3. src/plumbing/progress.rs +38 −37
Cargo.lock+1−133
@@ -51,15 +51,6 @@ version = "0.1.6" · 50 unmodified lines
5151 source = "registry+https://github.com/rust-lang/crates.io-index"
5252 checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
5353
54−[[package]]
55−name = "ansi-str"
56−version = "0.8.0"
57−source = "registry+https://github.com/rust-lang/crates.io-index"
58−checksum = "1cf4578926a981ab0ca955dc023541d19de37112bc24c1a197bd806d3d86ad1d"
59−dependencies = [
60− "ansitok",
61−]
62−
6354 [[package]]
6455 name = "ansiterm"
6556 version = "0.12.2"
@@ -69,16 +60,6 @@ dependencies = [ · 3 unmodified lines
6960 "winapi",
7061 ]
7162
72−[[package]]
73−name = "ansitok"
74−version = "0.2.0"
75−source = "registry+https://github.com/rust-lang/crates.io-index"
76−checksum = "220044e6a1bb31ddee4e3db724d29767f352de47445a6cd75e1a173142136c83"
77−dependencies = [
78− "nom",
79− "vte",
80−]
81−
8263 [[package]]
8364 name = "anstream"
8465 version = "0.6.5"
@@ -139,12 +120,6 @@ version = "1.6.0" · 54 unmodified lines
139120 source = "registry+https://github.com/rust-lang/crates.io-index"
140121 checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6"
141122
142−[[package]]
143−name = "arrayvec"
144−version = "0.5.2"
145−source = "registry+https://github.com/rust-lang/crates.io-index"
146−checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
147−
148123 [[package]]
149124 name = "arrayvec"
150125 version = "0.7.4"
@@ -448,12 +423,6 @@ version = "3.14.0" · 297 unmodified lines
448423 source = "registry+https://github.com/rust-lang/crates.io-index"
449424 checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
450425
451−[[package]]
452−name = "bytecount"
453−version = "0.6.7"
454−source = "registry+https://github.com/rust-lang/crates.io-index"
455−checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205"
456−
457426 [[package]]
458427 name = "byteorder"
459428 version = "1.5.0"
@@ -1279,7 +1248,6 @@ dependencies = [ · 819 unmodified lines
12791248 "owo-colors",
12801249 "prodash 28.0.0",
12811250 "serde_derive",
1282− "tabled",
12831251 "terminal_size",
12841252 "time",
12851253 "tracing",
@@ -3486,12 +3454,6 @@ version = "0.3.17" · 2200 unmodified lines
34863454 source = "registry+https://github.com/rust-lang/crates.io-index"
34873455 checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
34883456
3489−[[package]]
3490−name = "minimal-lexical"
3491−version = "0.2.1"
3492−source = "registry+https://github.com/rust-lang/crates.io-index"
3493−checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
3494−
34953457 [[package]]
34963458 name = "miniz_oxide"
34973459 version = "0.7.1"
@@ -3544,16 +3506,6 @@ dependencies = [ · 46 unmodified lines
35443506 "pin-utils",
35453507 ]
35463508
3547−[[package]]
3548−name = "nom"
3549−version = "7.1.3"
3550−source = "registry+https://github.com/rust-lang/crates.io-index"
3551−checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
3552−dependencies = [
3553− "memchr",
3554− "minimal-lexical",
3555−]
3556−
35573509 [[package]]
35583510 name = "ntapi"
35593511 version = "0.4.1"
@@ -3710,19 +3662,6 @@ version = "4.0.0" · 150 unmodified lines
37103662 source = "registry+https://github.com/rust-lang/crates.io-index"
37113663 checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f"
37123664
3713−[[package]]
3714−name = "papergrid"
3715−version = "0.11.0"
3716−source = "registry+https://github.com/rust-lang/crates.io-index"
3717−checksum = "9ad43c07024ef767f9160710b3a6773976194758c7919b17e63b863db0bdf7fb"
3718−dependencies = [
3719− "ansi-str",
3720− "ansitok",
3721− "bytecount",
3722− "fnv",
3723− "unicode-width",
3724−]
3725−
37263665 [[package]]
37273666 name = "parking"
37283667 version = "2.2.0"
@@ -3889,30 +3828,6 @@ dependencies = [ · 160 unmodified lines
38893828 "toml_edit",
38903829 ]
38913830
3892−[[package]]
3893−name = "proc-macro-error"
3894−version = "1.0.4"
3895−source = "registry+https://github.com/rust-lang/crates.io-index"
3896−checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
3897−dependencies = [
3898− "proc-macro-error-attr",
3899− "proc-macro2",
3900− "quote",
3901− "syn 1.0.109",
3902− "version_check",
3903−]
3904−
3905−[[package]]
3906−name = "proc-macro-error-attr"
3907−version = "1.0.4"
3908−source = "registry+https://github.com/rust-lang/crates.io-index"
3909−checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
3910−dependencies = [
3911− "proc-macro2",
3912− "quote",
3913− "version_check",
3914−]
3915−
39163831 [[package]]
39173832 name = "proc-macro2"
39183833 version = "1.0.75"
@@ -4646,32 +4561,6 @@ dependencies = [ · 727 unmodified lines
46464561 "libc",
46474562 ]
46484563
4649−[[package]]
4650−name = "tabled"
4651−version = "0.15.0"
4652−source = "registry+https://github.com/rust-lang/crates.io-index"
4653−checksum = "4c998b0c8b921495196a48aabaf1901ff28be0760136e31604f7967b0792050e"
4654−dependencies = [
4655− "ansi-str",
4656− "ansitok",
4657− "papergrid",
4658− "tabled_derive",
4659− "unicode-width",
4660−]
4661−
4662−[[package]]
4663−name = "tabled_derive"
4664−version = "0.7.0"
4665−source = "registry+https://github.com/rust-lang/crates.io-index"
4666−checksum = "4c138f99377e5d653a371cdad263615634cfc8467685dfe8e73e2b8e98f44b17"
4667−dependencies = [
4668− "heck",
4669− "proc-macro-error",
4670− "proc-macro2",
4671− "quote",
4672− "syn 1.0.109",
4673−]
4674−
46754564 [[package]]
46764565 name = "tar"
46774566 version = "0.4.40"
@@ -5034,7 +4923,7 @@ version = "3.0.0" · 356 unmodified lines
50344923 source = "registry+https://github.com/rust-lang/crates.io-index"
50354924 checksum = "794a32261a1f5eb6a4462c81b59cec87b5c27d5deea7dd1ac8fc781c41d226db"
50364925 dependencies = [
5037− "arrayvec 0.7.4",
4926+ "arrayvec",
50384927 ]
50394928
50404929 [[package]]
@@ -5129,27 +5018,6 @@ version = "0.9.4" · 88 unmodified lines
51295018 source = "registry+https://github.com/rust-lang/crates.io-index"
51305019 checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
51315020
5132−[[package]]
5133−name = "vte"
5134−version = "0.10.1"
5135−source = "registry+https://github.com/rust-lang/crates.io-index"
5136−checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983"
5137−dependencies = [
5138− "arrayvec 0.5.2",
5139− "utf8parse",
5140− "vte_generate_state_changes",
5141−]
5142−
5143−[[package]]
5144−name = "vte_generate_state_changes"
5145−version = "0.1.1"
5146−source = "registry+https://github.com/rust-lang/crates.io-index"
5147−checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff"
5148−dependencies = [
5149− "proc-macro2",
5150− "quote",
5151−]
5152−
51535021 [[package]]
51545022 name = "waker-fn"
51555023 version = "1.1.1"
Cargo.toml+0−1
@@ -190,7 +190,6 @@ tracing = { version = "0.1.37", optional = true } · 189 unmodified lines
190190 owo-colors = "4.0.0"
191191
192192 # for config-tree
193−tabled = { version = "0.15.0", features = ["ansi"] }
194193 terminal_size = "0.3.0"
195194
196195 # Avoid pre-compiled binaries, see https://github.com/serde-rs/serde/issues/2538 and https://github.com/serde-rs/serde/pull/2590
src/plumbing/progress.rs+38−37
@@ -5,9 +5,6 @@ use std::{ · 4 unmodified lines
55
66 use crosstermion::crossterm::style::Stylize;
77 use owo_colors::OwoColorize;
8−use tabled::settings::peaker::PriorityMax;
9−use tabled::settings::{Extract, Style, Width};
10−use tabled::Tabled;
118
129 #[derive(Clone)]
1310 enum Usage {
@@ -73,33 +70,35 @@ struct Record { · 59 unmodified lines
7370 usage: Usage,
7471 }
7572
76−impl Tabled for Record {
77− const LENGTH: usize = 3;
73+// TODO implement this without table, how hard is it?
7874
79− fn fields(&self) -> Vec<Cow<'_, str>> {
80− let mut tokens = self.config.split('.');
81− let mut buf = vec![{
82− let name = tokens.next().expect("present");
83− if name == "gitoxide" {
84− name.bold().green()
85− } else {
86− name.bold()
87− }
88− .to_string()
89− }];
90− buf.extend(tokens.map(ToOwned::to_owned));
75+// impl Tabled for Record {
76+// const LENGTH: usize = 3;
9177
92− vec![
93− Cow::Borrowed(self.usage.icon()),
94− buf.join(".").into(),
95− self.usage.to_string().into(),
96− ]
97− }
78+// fn fields(&self) -> Vec<Cow<'_, str>> {
79+// let mut tokens = self.config.split('.');
80+// let mut buf = vec![{
81+// let name = tokens.next().expect("present");
82+// if name == "gitoxide" {
83+// name.bold().green()
84+// } else {
85+// name.bold()
86+// }
87+// .to_string()
88+// }];
89+// buf.extend(tokens.map(ToOwned::to_owned));
9890
99− fn headers() -> Vec<Cow<'static, str>> {
100− vec!["icon".into(), "key".into(), "info".into()]
101− }
102−}
91+// vec![
92+// Cow::Borrowed(self.usage.icon()),
93+// buf.join(".").into(),
94+// self.usage.to_string().into(),
95+// ]
96+// }
97+
98+// fn headers() -> Vec<Cow<'static, str>> {
99+// vec!["icon".into(), "key".into(), "info".into()]
100+// }
101+// }
103102
104103 static GIT_CONFIG: &[Record] = &[
105104 Record {
@@ -575,16 +574,18 @@ pub fn show_progress() -> anyhow::Result<()> { · 469 unmodified lines
575574 .count()
576575 )?;
577576
578− let mut table = tabled::Table::new(sorted);
579− let table = table.with(Style::blank()).with(Extract::rows(1..));
580− println!(
581− "{}",
582− if let Some((terminal_size::Width(w), _)) = terminal_size::terminal_size() {
583− table.with(Width::wrap(w as usize).keep_words().priority::<PriorityMax>())
584− } else {
585− table
586− }
587− );
577+ // TODO implement this without table, how hard is it?
578+
579+ // let mut table = tabled::Table::new(sorted);
580+ // let table = table.with(Style::blank()).with(Extract::rows(1..));
581+ // println!(
582+ // "{}",
583+ // if let Some((terminal_size::Width(w), _)) = terminal_size::terminal_size() {
584+ // table.with(Width::wrap(w as usize).keep_words().priority::<PriorityMax>())
585+ // } else {
586+ // table
587+ // }
588+ // );
588589 println!("{buf}");
589590 Ok(())
590591 }