diff options
author | Romain <romain.liautaud@snips.ai> | 2018-05-18 12:38:45 +0200 |
---|---|---|
committer | Romain <romain.liautaud@snips.ai> | 2018-05-18 13:25:12 +0200 |
commit | 20cd1634ce15ae8ec5fec3d17095d29c3a524738 (patch) | |
tree | 8b064a5db7fb0a916f248205d3d440559d355b74 | |
parent | 149f0fd88d16fd9ca17b57e9a29c53b3eeac6277 (diff) |
Added the possibility to style the left and right border separately.
-rw-r--r-- | src/format.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/format.rs b/src/format.rs index 25f07ea..2f4b4a0 100644 --- a/src/format.rs +++ b/src/format.rs @@ -176,6 +176,16 @@ impl TableFormat { self.rborder = Some(border); } + /// Set the character used for left table border + pub fn left_border(&mut self, border: char) { + self.lborder = Some(border); + } + + /// Set the character used for right table border + pub fn right_border(&mut self, border: char) { + self.rborder = Some(border); + } + /// Set a line separator pub fn separator(&mut self, what: LinePosition, separator: LineSeparator) { *match what { @@ -295,6 +305,18 @@ impl FormatBuilder { self } + /// Set the character used for left table border + pub fn left_border(mut self, border: char) -> Self { + self.format.left_border(border); + self + } + + /// Set the character used for right table border + pub fn right_border(mut self, border: char) -> Self { + self.format.right_border(border); + self + } + /// Set a line separator format pub fn separator(mut self, what: LinePosition, separator: LineSeparator) -> Self { self.format.separator(what, separator); |