Skip to content

Commit 9bad2a6

Browse files
committed
models/TopVersions: Remove highest fallback from highest_stable
1 parent 2ca8ecc commit 9bad2a6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/models/version.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ pub struct NewVersion {
4343
pub struct TopVersions {
4444
/// The "highest" version in terms of semver
4545
pub highest: Option<semver::Version>,
46-
/// The "highest" non-prerelease version, or, if only
47-
/// prereleases exist, the "highest" version
46+
/// The "highest" non-prerelease version
4847
pub highest_stable: Option<semver::Version>,
4948
/// The "newest" version in terms of publishing date
5049
pub newest: Option<semver::Version>,
@@ -70,8 +69,7 @@ impl TopVersions {
7069
.into_iter()
7170
.map(|(_, v)| v)
7271
.filter(|v| !v.is_prerelease())
73-
.max()
74-
.or_else(|| highest.clone());
72+
.max();
7573

7674
Self {
7775
newest,
@@ -302,7 +300,7 @@ mod tests {
302300
TopVersions::from_date_version_pairs(versions),
303301
TopVersions {
304302
highest: Some(version("1.0.0-beta.5")),
305-
highest_stable: Some(version("1.0.0-beta.5")),
303+
highest_stable: None,
306304
newest: Some(version("1.0.0-beta.5")),
307305
}
308306
);

0 commit comments

Comments
 (0)