Merge pull request #93 from mcrossman/master

Make feed sorting case-insensitive
This commit is contained in:
Spike 2021-02-02 19:13:35 -08:00 committed by GitHub
commit c7a2c43287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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