From 5c69ec246fa3d6f4276a0d2f33ec684520e2256f Mon Sep 17 00:00:00 2001 From: hcpl Date: Tue, 6 Jun 2017 21:44:40 +0300 Subject: Fix usage of non-unicode in unicode code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From '|' (0x007C) to '│' (0x2502). And sorry for repetitive "code" in commit message :( --- examples/formatting.rs | 10 +++++----- src/lib.rs | 12 ++++++------ 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); -- cgit v1.2.3