Fix feed sorting to be case-insensitive.

This commit is contained in:
Matthew Crossman 2021-02-03 10:53:09 +11:00
parent 8a27b2bac8
commit 9824370771
No known key found for this signature in database
GPG key ID: C6B942B019794CC2

View file

@ -95,7 +95,7 @@ pub async fn subscriptions(req: HttpRequest) -> HttpResponse {
// Modify sub list based on action
if action == "subscribe" && !sub_list.contains(&sub) {
sub_list.push(sub.to_owned());
sub_list.sort();
sub_list.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase()));
} else if action == "unsubscribe" {
sub_list.retain(|s| s != &sub);
}