Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rest of community sorts. Fixes #3374 #3376

Merged
merged 7 commits into from Jul 3, 2023

Conversation

dessalines
Copy link
Member

No description provided.

@dessalines dessalines requested a review from Nutomic as a code owner June 27, 2023 11:41
@L3v3L
Copy link
Contributor

L3v3L commented Jun 27, 2023

didn't know about this one

@@ -183,12 +183,33 @@ impl<'a> CommunityQuery<'a> {
}

match self.sort.unwrap_or(SortType::Hot) {
SortType::Hot => query = query.order_by(community_aggregates::hot_rank.desc()),
SortType::Active => query = query.order_by(community_aggregates::hot_rank.desc()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be easier to read if you put use SortType::* before the match. Then you can do Hot | Active => ... in cases where the same statement is used for multiple cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K done.

@Nutomic Nutomic force-pushed the add_missing_community_sorts branch from c276426 to bf8110c Compare June 29, 2023 12:42
@Nutomic Nutomic enabled auto-merge (squash) June 29, 2023 12:43
@L3v3L L3v3L mentioned this pull request Jun 29, 2023
@Nutomic
Copy link
Member

Nutomic commented Jun 30, 2023

Clippy is complaining that you should move the use.

@Nutomic Nutomic merged commit 935b0bf into main Jul 3, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants