summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhcpl <hcpl.prog@gmail.com>2017-06-04 20:07:08 +0300
committerhcpl <hcpl.prog@gmail.com>2017-06-04 20:07:08 +0300
commit83b551b9d15cc04cac8c045eee7f97eb301ecc92 (patch)
tree7ca6b01b481213761f570a75a0676c98c6d5962f /src
parent766cf017cd3744598e6267c060ce7565548a5168 (diff)
Retain existing public API but deprecate it
Diffstat (limited to 'src')
-rw-r--r--src/format.rs25
1 files changed, 18 insertions, 7 deletions
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<T: Write + ?Sized>(&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<T: Write + ?Sized>(&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(()),
}