We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 881ff2c commit baadd1dCopy full SHA for baadd1d
src/controllers/krate/search.rs
@@ -181,7 +181,7 @@ pub fn search(req: &mut Request) -> CargoResult<Response> {
181
.map(|versions| {
182
versions
183
.into_iter()
184
- .max_by(Version::semantically_newest_first)
+ .max_by(Version::semver_cmp)
185
.unwrap()
186
})
187
.collect::<Vec<_>>();
src/version/mod.rs
@@ -175,8 +175,8 @@ impl Version {
175
}
176
177
/// Orders SemVer numbers so that "higher" version numbers appear first.
178
- pub fn semantically_newest_first(a: &Self, b: &Self) -> ::std::cmp::Ordering {
179
- b.num.cmp(&a.num)
+ pub fn semver_cmp(a: &Self, b: &Self) -> ::std::cmp::Ordering {
+ a.num.cmp(&b.num)
180
0 commit comments