summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com>2018-09-19 10:27:00 +0200
committerPierre-Henri Symoneaux <pierre.henri.symoneaux@gmail.com>2018-09-19 10:38:37 +0200
commit94f7fe6a97abdd27ff15f1618c6d095163049941 (patch)
treed1da80c06a77ac454ad1943dfc3f996e493de607
parent71800c979d54e1ecf698798f12aed06fb707618f (diff)
A bunch of deprecations before reducing functions visibility
-rw-r--r--src/cell.rs4
-rw-r--r--src/format.rs4
-rw-r--r--src/lib.rs2
-rw-r--r--src/row.rs5
4 files changed, 14 insertions, 1 deletions
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<T: Write + ?Sized>(
&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<T: Terminal + ?Sized>(
&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<T: Write + ?Sized>(&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<T: Write + ?Sized>(&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<T: Write + ?Sized>(&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<T: Write + ?Sized>(&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<T: Terminal + ?Sized>(&self,
out: &mut T,
format: &TableFormat,