From 980a8b73d70acf5d33be8f7ca5af086817362bb6 Mon Sep 17 00:00:00 2001 From: Jim Verheijde Date: Fri, 26 Oct 2018 00:09:11 +0800 Subject: [PATCH] Fix an off by one error --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ab30d52..ccf4f5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,7 @@ fn to_text_box(lines: Vec<&str>, width: usize) -> String { // Process middle lines let middle_lines = &lines[1..lines.len() - 1]; let mut between: String = String::from(""); - if middle_lines.len() > 1 { + if middle_lines.len() >= 1 { for middle_line in middle_lines { between.push_str(&format!("| {: <1$}|\n", middle_line, width + 1)); }