make AUR sorting less stupid

This commit is contained in:
kageru 2020-06-09 20:53:28 +02:00
parent 1edd6152dc
commit a1950b076f
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

View File

@ -17,11 +17,10 @@ pub fn query_aur(ctx: Context, msg: Message, args: Vec<&str>) {
return;
}
response.results.sort_by(|a, b| {
a.popularity
.partial_cmp(&b.popularity)
b.popularity
.partial_cmp(&a.popularity)
.unwrap_or(std::cmp::Ordering::Less)
});
response.results.reverse();
respond_with_results(msg.channel_id, &response.results, &ctx);
}