diff --git a/src/github/graphql.rs b/src/github/graphql.rs index 810c778..c27a114 100644 --- a/src/github/graphql.rs +++ b/src/github/graphql.rs @@ -245,7 +245,7 @@ impl GithubClient { } // Sort by updated_at descending - inbox.sort_by(|a, b| b.updated_at.cmp(&a.updated_at)); + inbox.sort_by_key(|item| std::cmp::Reverse(item.updated_at)); debug!(count = inbox.len(), "Fetched inbox"); Ok((inbox, rate_limit)) diff --git a/src/ui/widgets.rs b/src/ui/widgets.rs index 313be2f..f675e67 100644 --- a/src/ui/widgets.rs +++ b/src/ui/widgets.rs @@ -262,7 +262,7 @@ fn render_org_overview( .iter() .filter(|r| !r.is_archived && r.open_pr_count > 0) .collect(); - repos_with_prs.sort_by(|a, b| b.open_pr_count.cmp(&a.open_pr_count)); + repos_with_prs.sort_by_key(|r| std::cmp::Reverse(r.open_pr_count)); if !repos_with_prs.is_empty() { lines.push(Line::from(Span::styled(