-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve badge ordering #28
base: main
Are you sure you want to change the base?
Conversation
Fails on "U/1U,U/11,U/5" for example it does not satisfy a > b && b > c => a > c |
match self.set_id.partial_cmp(&other.set_id) { | ||
Some(core::cmp::Ordering::Equal) => {} | ||
// XXX: order known badges like first-party site | ||
// FIXME: is the reflexive and transitive? as needed by Ord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this fail?
src/badges.rs
Outdated
self.id.as_str().parse::<u32>(), | ||
other.id.as_str().parse::<u32>(), | ||
) { | ||
(Ok(s), Ok(other)) if s != other => s.partial_cmp(&other), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"01".parse() == "1".parse()
, but they are not equal, this fixes that
Co-authored-by: Emil Gardström <[email protected]>
This has some issues, but posting what I have so far.
The implementation is currently not sufficiently transitive for implementing Ord