From 1586c335b797676252f412f25c5f58854fe110f9 Mon Sep 17 00:00:00 2001 From: Lin Yihai Date: Mon, 29 Jul 2024 10:36:47 +0800 Subject: [PATCH] doc: Add mod level documents --- src/cargo/util/semver_eval_ext.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cargo/util/semver_eval_ext.rs b/src/cargo/util/semver_eval_ext.rs index 4fe913f37369..c38e3cdbd612 100644 --- a/src/cargo/util/semver_eval_ext.rs +++ b/src/cargo/util/semver_eval_ext.rs @@ -1,3 +1,11 @@ +//! This module provides the [`matches_prerelease`] to extends the semantic for how to match a prerelease version. +//! Please refer to the semantic proposal, see +//! [3493-precise-pre-release-cargo-update](https://rust-lang.github.io/rfcs/3493-precise-pre-release-cargo-update.html) +//! +//! Thanks to [`semver`]'s prior art, we copied the private functions from it, which includes [`matches_exact`], [`matches_greater`], [`matches_less`]. +//! The tests in [`matches_prerelease_semantic`] are designed to reflect the proposal semantic. +//! + use semver::{Comparator, Op, Prerelease, Version, VersionReq}; pub(crate) fn matches_prerelease(req: &VersionReq, ver: &Version) -> bool {