From 94f7fe6a97abdd27ff15f1618c6d095163049941 Mon Sep 17 00:00:00 2001 From: Pierre-Henri Symoneaux Date: Wed, 19 Sep 2018 10:27:00 +0200 Subject: A bunch of deprecations before reducing functions visibility --- src/cell.rs | 4 ++++ src/format.rs | 4 +++- src/lib.rs | 2 ++ src/row.rs | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cell.rs b/src/cell.rs index de13f36..d1d9a3c 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -176,11 +176,13 @@ impl Cell { } /// Return the height of the cell + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn get_height(&self) -> usize { self.content.len() } /// Return the width of the cell + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn get_width(&self) -> usize { self.width } @@ -204,6 +206,7 @@ impl Cell { /// `idx` is the line index to print. `col_width` is the column width used to /// fill the cells with blanks so it fits in the table. /// If `ìdx` is higher than this cell's height, it will print empty content + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn print( &self, out: &mut T, @@ -216,6 +219,7 @@ impl Cell { } /// Apply style then call `print` to print the cell into a terminal + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn print_term( &self, out: &mut T, diff --git a/src/format.rs b/src/format.rs index 2f4b4a0..45405ca 100644 --- a/src/format.rs +++ b/src/format.rs @@ -68,7 +68,7 @@ impl LineSeparator { } /// Print a full line separator to `out`. `col_width` is a slice containing the width of each column - #[deprecated(since = "0.6.7", note = "function will be removed. See [issue #57](https://github.com/phsym/prettytable-rs/pull/57).")] + #[deprecated(since = "0.6.7", note = "function will become private. See [issue #57](https://github.com/phsym/prettytable-rs/pull/57) and [issue #87](https://github.com/phsym/prettytable-rs/issues/87).")] pub fn print(&self, out: &mut T, col_width: &[usize], @@ -228,6 +228,7 @@ impl TableFormat { } /// Print a full line separator to `out`. `col_width` is a slice containing the width of each column + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn print_line_separator(&self, out: &mut T, col_width: &[usize], @@ -259,6 +260,7 @@ impl TableFormat { } /// Print a column separator or a table border + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn print_column_separator(&self, out: &mut T, pos: ColumnPosition) diff --git a/src/lib.rs b/src/lib.rs index 03c011a..25018ed 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,6 +72,7 @@ pub struct TableSlice<'a> { impl<'a> TableSlice<'a> { /// Compute and return the number of column + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn get_column_num(&self) -> usize { let mut cnum = 0; for r in self.rows { @@ -297,6 +298,7 @@ impl Table { } /// Compute and return the number of column + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn get_column_num(&self) -> usize { self.as_ref().get_column_num() } diff --git a/src/row.rs b/src/row.rs index a604dc7..75ce89a 100644 --- a/src/row.rs +++ b/src/row.rs @@ -31,6 +31,7 @@ impl Row { /// Count the number of column required in the table grid. /// It takes into account horizontal spanning of cells. For /// example, a cell with an hspan of 3 will add 3 column to the grid + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn column_count(&self) -> usize { self.cells.iter().map(|c| c.get_hspan()).sum() } @@ -47,6 +48,7 @@ impl Row { } /// Get the height of this row + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn get_height(&self) -> usize { let mut height = 1; // Minimum height must be 1 to print empty rows for cell in &self.cells { @@ -60,6 +62,7 @@ impl Row { /// Get the minimum width required by the cell in the column `column`. /// Return 0 if the cell does not exist in this row + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize { let mut i = 0; for c in &self.cells { @@ -186,6 +189,7 @@ impl Row { /// Print the row to `out`, with `separator` as column separator, and `col_width` /// specifying the width of each columns + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn print(&self, out: &mut T, format: &TableFormat, @@ -196,6 +200,7 @@ impl Row { /// Print the row to terminal `out`, with `separator` as column separator, and `col_width` /// specifying the width of each columns. Apply style when needed + #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")] pub fn print_term(&self, out: &mut T, format: &TableFormat, -- cgit v1.2.3