From 83b551b9d15cc04cac8c045eee7f97eb301ecc92 Mon Sep 17 00:00:00 2001 From: hcpl Date: Sun, 4 Jun 2017 20:07:08 +0300 Subject: Retain existing public API but deprecate it --- src/format.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/format.rs') diff --git a/src/format.rs b/src/format.rs index a9b77cb..411ec41 100644 --- a/src/format.rs +++ b/src/format.rs @@ -57,14 +57,25 @@ 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 = "assumes padding is always (1, 1)")] pub fn print(&self, out: &mut T, col_width: &[usize], - padding: (usize, usize), colsep: bool, lborder: bool, rborder: bool) -> Result<(), Error> { + self.real_print(out, col_width, (1, 1), colsep, lborder, rborder) + } + + fn real_print(&self, + out: &mut T, + col_width: &[usize], + padding: (usize, usize), + colsep: bool, + lborder: bool, + rborder: bool) + -> Result<(), Error> { if lborder { try!(out.write_all(Utf8Char::from(self.ljunc).as_bytes())); } @@ -190,12 +201,12 @@ impl TableFormat { -> Result<(), Error> { match *self.get_sep_for_line(pos) { Some(ref l) => { - l.print(out, - col_width, - self.get_padding(), - self.csep.is_some(), - self.lborder.is_some(), - self.rborder.is_some()) + l.real_print(out, + col_width, + self.get_padding(), + self.csep.is_some(), + self.lborder.is_some(), + self.rborder.is_some()) } None => Ok(()), } -- cgit v1.2.3