summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhcpl <hcpl.prog@gmail.com>2017-06-06 21:44:40 +0300
committerhcpl <hcpl.prog@gmail.com>2017-06-06 21:44:40 +0300
commit5c69ec246fa3d6f4276a0d2f33ec684520e2256f (patch)
treee453b8caa85936114e875cc2b0184c5bacc8c24f
parent96c072bac8b39462b2092df650ecc3465f641763 (diff)
Fix usage of non-unicode in unicode code.
From '|' (0x007C) to '│' (0x2502). And sorry for repetitive "code" in commit message :(
-rw-r--r--examples/formatting.rs10
-rw-r--r--src/lib.rs12
2 files changed, 11 insertions, 11 deletions
diff --git a/examples/formatting.rs b/examples/formatting.rs
index 964cff7..7822866 100644
--- a/examples/formatting.rs
+++ b/examples/formatting.rs
@@ -64,16 +64,16 @@ fn main() {
// Customized format with unicode
// Example to print
// ┌─────────────┬────────────┐
- // | Title 1 | Title 2 |
+ // │ Title 1 │ Title 2 │
// ├─────────────┼────────────┤
- // | Value 1 | Value 2 |
+ // │ Value 1 │ Value 2 │
// ├─────────────┼────────────┤
- // | Value three | Value four |
+ // │ Value three │ Value four │
// └─────────────┴────────────┘
println!("With unicode:");
table.set_format(format::FormatBuilder::new()
- .column_separator('|')
- .borders('|')
+ .column_separator('│')
+ .borders('│')
.separators(&[format::LinePosition::Top],
format::LineSeparator::new('─', '┬', '┌', '┐'))
.separators(&[format::LinePosition::Intern],
diff --git a/src/lib.rs b/src/lib.rs
index e773cfd..25029f3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -773,7 +773,7 @@ mod tests {
table.add_row(Row::new(vec![Cell::new("def"), Cell::new("bc"), Cell::new("a")]));
table.set_titles(Row::new(vec![Cell::new("t1"), Cell::new("t2"), Cell::new("t3")]));
table.get_format().indent(8);
- let out = r" +-----+----+-----+
+ let out = " +-----+----+-----+
| t1 | t2 | t3 |
+=====+====+=====+
| a | bc | def |
@@ -816,8 +816,8 @@ mod tests {
fn test_unicode_separators() {
let mut table = Table::new();
table.set_format(format::FormatBuilder::new()
- .column_separator('|')
- .borders('|')
+ .column_separator('│')
+ .borders('│')
.separators(&[format::LinePosition::Top],
format::LineSeparator::new('─',
'┬',
@@ -840,11 +840,11 @@ mod tests {
table.set_titles(Row::new(vec![Cell::new("t1"), Cell::new("t2"), Cell::new("t3")]));
let out = "\
┌────┬────┬────┐
-| t1 | t2 | t3 |
+│ t1 │ t2 │ t3 │
├────┼────┼────┤
-| 1 | 1 | 1 |
+│ 1 │ 1 │ 1 │
├────┼────┼────┤
-| 2 | 2 | 2 |
+│ 2 │ 2 │ 2 │
└────┴────┴────┘
";
println!("{}", out);