From 7feff249a44af01dec934dab67c0eb4c8c16bd09 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Mon, 17 Feb 2020 14:31:12 -0500 Subject: [PATCH] end should make min from items.len instead of total_pages --- youmubot-cf/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youmubot-cf/src/lib.rs b/youmubot-cf/src/lib.rs index 73209e5..46c9b03 100644 --- a/youmubot-cf/src/lib.rs +++ b/youmubot-cf/src/lib.rs @@ -260,7 +260,7 @@ pub fn contestranks(ctx: &mut Context, m: &Message, mut args: Args) -> CommandRe move |page, e| { let page = page as usize; let start = page * ITEMS_PER_PAGE; - let end = total_pages.min(start + ITEMS_PER_PAGE); + let end = ranks.len().min(start + ITEMS_PER_PAGE); if start >= end { return (e, Err(Error::from("no more pages to show"))); }