Skip to content

Commit cf7dca3

Browse files
committed
Privatize deprecated functions functions for #87
1 parent 6bb234c commit cf7dca3

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

src/cell.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ impl Cell {
176176
}
177177

178178
/// Return the height of the cell
179-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
180-
pub fn get_height(&self) -> usize {
179+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
180+
pub (crate) fn get_height(&self) -> usize {
181181
self.content.len()
182182
}
183183

184184
/// Return the width of the cell
185-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
186-
pub fn get_width(&self) -> usize {
185+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
186+
pub (crate) fn get_width(&self) -> usize {
187187
self.width
188188
}
189189

@@ -206,8 +206,8 @@ impl Cell {
206206
/// `idx` is the line index to print. `col_width` is the column width used to
207207
/// fill the cells with blanks so it fits in the table.
208208
/// If `ìdx` is higher than this cell's height, it will print empty content
209-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
210-
pub fn print<T: Write + ?Sized>(
209+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
210+
pub (crate) fn print<T: Write + ?Sized>(
211211
&self,
212212
out: &mut T,
213213
idx: usize,
@@ -219,8 +219,8 @@ impl Cell {
219219
}
220220

221221
/// Apply style then call `print` to print the cell into a terminal
222-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
223-
pub fn print_term<T: Terminal + ?Sized>(
222+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
223+
pub (crate) fn print_term<T: Terminal + ?Sized>(
224224
&self,
225225
out: &mut T,
226226
idx: usize,

src/format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ impl TableFormat {
220220

221221
/// Print a full line separator to `out`. `col_width` is a slice containing the width of each column.
222222
/// Returns the number of printed lines
223-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
224-
pub fn print_line_separator<T: Write + ?Sized>(&self,
223+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
224+
pub (crate) fn print_line_separator<T: Write + ?Sized>(&self,
225225
out: &mut T,
226226
col_width: &[usize],
227227
pos: LinePosition)
@@ -252,8 +252,8 @@ impl TableFormat {
252252
}
253253

254254
/// Print a column separator or a table border
255-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
256-
pub fn print_column_separator<T: Write + ?Sized>(&self,
255+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
256+
pub (crate) fn print_column_separator<T: Write + ?Sized>(&self,
257257
out: &mut T,
258258
pos: ColumnPosition)
259259
-> Result<(), Error> {

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ pub struct TableSlice<'a> {
6868

6969
impl<'a> TableSlice<'a> {
7070
/// Compute and return the number of column
71-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
72-
pub fn get_column_num(&self) -> usize {
71+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
72+
fn get_column_num(&self) -> usize {
7373
let mut cnum = 0;
7474
for r in self.rows {
7575
let l = r.column_count();
@@ -256,8 +256,9 @@ impl Table {
256256
}
257257

258258
/// Compute and return the number of column
259-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
260-
pub fn get_column_num(&self) -> usize {
259+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
260+
#[cfg(test)] // Only used for testing for now
261+
pub (crate) fn get_column_num(&self) -> usize {
261262
self.as_ref().get_column_num()
262263
}
263264

src/row.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ impl Row {
3131
/// Count the number of column required in the table grid.
3232
/// It takes into account horizontal spanning of cells. For
3333
/// example, a cell with an hspan of 3 will add 3 column to the grid
34-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
35-
pub fn column_count(&self) -> usize {
34+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
35+
pub (crate) fn column_count(&self) -> usize {
3636
self.cells.iter().map(|c| c.get_hspan()).sum()
3737
}
3838

@@ -48,8 +48,8 @@ impl Row {
4848
}
4949

5050
/// Get the height of this row
51-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
52-
pub fn get_height(&self) -> usize {
51+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
52+
fn get_height(&self) -> usize {
5353
let mut height = 1; // Minimum height must be 1 to print empty rows
5454
for cell in &self.cells {
5555
let h = cell.get_height();
@@ -62,8 +62,8 @@ impl Row {
6262

6363
/// Get the minimum width required by the cell in the column `column`.
6464
/// Return 0 if the cell does not exist in this row
65-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
66-
pub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize {
65+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
66+
pub (crate) fn get_column_width(&self, column: usize, format: &TableFormat) -> usize {
6767
let mut i = 0;
6868
for c in &self.cells {
6969
if i + c.get_hspan() > column {
@@ -186,8 +186,8 @@ impl Row {
186186

187187
/// Print the row to `out`, with `separator` as column separator, and `col_width`
188188
/// specifying the width of each columns. Returns the number of printed lines
189-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
190-
pub fn print<T: Write + ?Sized>(&self,
189+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
190+
pub (crate) fn print<T: Write + ?Sized>(&self,
191191
out: &mut T,
192192
format: &TableFormat,
193193
col_width: &[usize])
@@ -197,8 +197,8 @@ impl Row {
197197

198198
/// Print the row to terminal `out`, with `separator` as column separator, and `col_width`
199199
/// specifying the width of each columns. Apply style when needed. returns the number of printed lines
200-
#[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
201-
pub fn print_term<T: Terminal + ?Sized>(&self,
200+
// #[deprecated(since="0.8.0", note="Will become private in future release. See [issue #87](https://github.com/phsym/prettytable-rs/issues/87)")]
201+
pub (crate) fn print_term<T: Terminal + ?Sized>(&self,
202202
out: &mut T,
203203
format: &TableFormat,
204204
col_width: &[usize])

0 commit comments

Comments
 (0)