File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,8 @@ impl Crate {
331331 }
332332
333333 /// Return both the newest (most recently updated) and
334- /// highest version (in semver order) for the current crate.
334+ /// highest version (in semver order) for the current crate,
335+ /// where all top versions are not yanked.
335336 pub fn top_versions ( & self , conn : & mut impl Conn ) -> QueryResult < TopVersions > {
336337 Ok ( TopVersions :: from_date_version_pairs (
337338 self . versions ( )
@@ -475,10 +476,12 @@ impl From<BoxedAppError> for OwnerAddError {
475476}
476477
477478pub trait CrateVersions {
479+ /// Return all non-yanked versions of a crate.
478480 fn versions ( & self ) -> versions:: BoxedQuery < ' _ , Pg > {
479481 self . all_versions ( ) . filter ( versions:: yanked. eq ( false ) )
480482 }
481483
484+ /// Return all versions of a crate, including yanked ones.
482485 fn all_versions ( & self ) -> versions:: BoxedQuery < ' _ , Pg > ;
483486}
484487
Original file line number Diff line number Diff line change @@ -126,6 +126,8 @@ fn strip_build_metadata(version: &str) -> &str {
126126
127127/// The highest version (semver order) and the most recently updated version.
128128/// Typically used for a single crate.
129+ /// Note: `TopVersion` itself does not guarantee whether versions are yanked or not,
130+ /// this must be guaranteed by the input versions.
129131#[ derive( Debug , Clone , Eq , PartialEq ) ]
130132pub struct TopVersions {
131133 /// The "highest" version in terms of semver
You can’t perform that action at this time.
0 commit comments