finish up for merge

This commit is contained in:
Johann150 2021-03-23 23:25:04 +01:00
parent 782e043083
commit eec057515d
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1
3 changed files with 9 additions and 5 deletions

View file

@ -194,9 +194,10 @@ impl CertStore {
// length of either a or b and the for loop will not decide.
for (a_part, b_part) in a.split('.').rev().zip(b.split('.').rev()) {
if a_part != b_part {
// What we sort by here is not really important, but `str`
// already implements Ord, making it easier for us.
return a_part.cmp(b_part);
// Here we have to make sure that the empty string will
// always be sorted to the end, so we reverse the usual
// ordering of str.
return a_part.cmp(b_part).reverse();
}
}
// Sort longer domains first.