From f74d1affb6fc2aa37c2205e4cd8cb835caabec68 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Sat, 29 Jun 2024 13:26:09 -0400 Subject: [PATCH] fix(posts): manually sort by flags (#168) * fix(posts): manually sort by flags * fix(posts): shorten sort call --- src/utils.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.rs b/src/utils.rs index 52c66d1..52f81a3 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -424,6 +424,7 @@ impl Post { }); } posts.sort_by(|a, b| b.created_ts.cmp(&a.created_ts)); + posts.sort_by(|a, b| b.flags.stickied.cmp(&a.flags.stickied)); Ok((posts, res["data"]["after"].as_str().unwrap_or_default().to_string())) } }