From a4ec53e0cfc3a27d732f65dcde761c1b2e89a6e3 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 11 Sep 2022 21:43:12 +0200 Subject: [PATCH] Fix duplicate entry on new pages in paginator --- src/commands/utils.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/utils.rs b/src/commands/utils.rs index 3130f20..5685a43 100644 --- a/src/commands/utils.rs +++ b/src/commands/utils.rs @@ -35,9 +35,10 @@ pub fn paginator(input: Vec, chunk_size: usize, join_string: String) -> if part.chars().count() + i.chars().count() + filler >= chunk_size { result.push(part); part = i.to_string(); + } else { + part.push_str(&join_string); + part.push_str(&i.to_string()); } - part.push_str(&join_string); - part.push_str(&i.to_string()); } result.push(part); return result;