diff options
author | Pierre-Henri Symoneaux <phsym@users.noreply.github.com> | 2019-08-26 22:00:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 22:00:25 +0200 |
commit | 6bb234c979f8153f8ee8eede5cbb9a1ae2658f23 (patch) | |
tree | 3240b3ffdd53f569627d63484030bba6f15b3dd2 /src/format.rs | |
parent | bdfb15081cf5e44934a08941f18a6eaba8275e1e (diff) | |
parent | 2040ec8190518db84d1651c596950488750ab567 (diff) |
Merge pull request #114 from phsym/printstd-nopanic
Remove panic in print_tty and return a Result
Diffstat (limited to 'src/format.rs')
-rw-r--r-- | src/format.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/format.rs b/src/format.rs index ddf6713..9339348 100644 --- a/src/format.rs +++ b/src/format.rs @@ -60,10 +60,10 @@ impl LineSeparator { /// and `junc` is the one used for junctions between columns and lines pub fn new(line: char, junc: char, ljunc: char, rjunc: char) -> LineSeparator { LineSeparator { - line: line, - junc: junc, - ljunc: ljunc, - rjunc: rjunc, + line, + junc, + ljunc, + rjunc, } } @@ -80,7 +80,7 @@ impl LineSeparator { if lborder { out.write_all(Utf8Char::from(self.ljunc).as_bytes())?; } - let mut iter = col_width.into_iter().peekable(); + let mut iter = col_width.iter().peekable(); while let Some(width) = iter.next() { for _ in 0..width + padding.0 + padding.1 { out.write_all(Utf8Char::from(self.line).as_bytes())?; |