From 25841e225ecfe33479695236288002ecdeb33f6f Mon Sep 17 00:00:00 2001 From: Maxim Zhiburt Date: Sun, 21 Nov 2021 00:16:06 +0300 Subject: [PATCH] tabled/ remove papergrid from public sdk --- examples/basic.rs | 2 +- examples/inline.rs | 3 +-- examples/panel.rs | 4 +--- src/alignment.rs | 8 ++++---- src/highlight.rs | 4 +++- src/lib.rs | 5 ++--- tests/highlingt_test.rs | 3 +-- tests/panel_test.rs | 3 +-- tests/rotate_test.rs | 2 +- 9 files changed, 15 insertions(+), 19 deletions(-) diff --git a/examples/basic.rs b/examples/basic.rs index dec58641..eaa8df49 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -1,7 +1,7 @@ //! The example can be run by this command //! `cargo run --example basic` -use tabled::{papergrid::AlignmentHorizontal, Alignment, Head, Modify, Row, Style, Table, Tabled}; +use tabled::{Alignment, AlignmentHorizontal, Head, Modify, Row, Style, Table, Tabled}; #[derive(Tabled)] struct Distribution { diff --git a/examples/inline.rs b/examples/inline.rs index 09d48d1f..f0ee3ed4 100644 --- a/examples/inline.rs +++ b/examples/inline.rs @@ -2,8 +2,7 @@ //! `cargo run --example inline` use tabled::{ - papergrid::AlignmentHorizontal, Alignment, Full, Head, Indent, Modify, Row, Style, Table, - Tabled, + Alignment, AlignmentHorizontal, Full, Head, Indent, Modify, Row, Style, Table, Tabled, }; fn main() { diff --git a/examples/panel.rs b/examples/panel.rs index 714f8bf0..63ba9391 100644 --- a/examples/panel.rs +++ b/examples/panel.rs @@ -1,9 +1,7 @@ //! The example can be run by this command //! `cargo run --example panel` -use tabled::{ - papergrid::AlignmentHorizontal, Alignment, Footer, Full, Header, Modify, Style, Table, Tabled, -}; +use tabled::{Alignment, AlignmentHorizontal, Footer, Full, Header, Modify, Style, Table, Tabled}; #[derive(Tabled)] struct Release { diff --git a/src/alignment.rs b/src/alignment.rs index 86ac33dc..83be2e71 100644 --- a/src/alignment.rs +++ b/src/alignment.rs @@ -1,9 +1,9 @@ use crate::CellOption; -#[allow(unused)] -use crate::Table; -use papergrid::{AlignmentHorizontal, AlignmentVertical, Entity, Grid, Settings}; +use papergrid::{Entity, Grid, Settings}; -/// Alignment represent a horizontal and vertical alignemt setting for any cell on a [Table]. +pub use papergrid::{AlignmentHorizontal, AlignmentVertical}; + +/// Alignment represent a horizontal and vertical alignemt setting for any cell on a [crate::Table]. /// /// ```rust,no_run /// # use tabled::{Style, Alignment, Modify, Row, Table}; diff --git a/src/highlight.rs b/src/highlight.rs index 2268f5c0..5a772e8c 100644 --- a/src/highlight.rs +++ b/src/highlight.rs @@ -1,7 +1,9 @@ #[allow(unused)] use crate::Table; use crate::TableOption; -use papergrid::{Border, Entity, Grid, Settings}; +use papergrid::{Entity, Grid, Settings}; + +pub use papergrid::Border; pub struct Highlight { target: Target, diff --git a/src/lib.rs b/src/lib.rs index 9a21277b..221b1404 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -141,7 +141,7 @@ //! [README.md](https://github.com/zhiburt/tabled/blob/master/README.md) //! -use papergrid::{AlignmentHorizontal, Entity, Grid, Settings}; +use papergrid::{Entity, Grid, Settings}; use std::fmt; mod alignment; @@ -160,8 +160,7 @@ pub use crate::{ alignment::*, disable::*, formating::*, highlight::*, indent::*, object::*, panel::*, rotate::*, style::Style, width::*, }; -// todo: Remove this publice exposure -pub use papergrid; + pub use tabled_derive::Tabled; /// Tabled a trait responsible for providing a header fields and a row fields. diff --git a/tests/highlingt_test.rs b/tests/highlingt_test.rs index 7c71a5ca..e23d5d97 100644 --- a/tests/highlingt_test.rs +++ b/tests/highlingt_test.rs @@ -1,6 +1,5 @@ use crate::util::create_vector; -use papergrid::Border; -use tabled::{Highlight, Style, Table}; +use tabled::{Border, Highlight, Style, Table}; mod util; diff --git a/tests/panel_test.rs b/tests/panel_test.rs index b535bb36..deda0241 100644 --- a/tests/panel_test.rs +++ b/tests/panel_test.rs @@ -1,7 +1,6 @@ use crate::util::create_vector; use tabled::{ - papergrid::Border, Alignment, Footer, Full, Header, Highlight, Modify, Object, Panel, Row, - Style, Table, + Alignment, Border, Footer, Full, Header, Highlight, Modify, Object, Panel, Row, Style, Table, }; mod util; diff --git a/tests/rotate_test.rs b/tests/rotate_test.rs index 8dbcacc6..699d92bc 100644 --- a/tests/rotate_test.rs +++ b/tests/rotate_test.rs @@ -1,6 +1,6 @@ // todo: add method for SPACING between cells. // add MARGIN && PADDING instead of indent? -use tabled::{papergrid::Border, Highlight, Rotate, Style, Table}; +use tabled::{Border, Highlight, Rotate, Style, Table}; #[test] fn test_rotate() {