From 73d9c24b3edf0f87a6e1c78ca56349f94ced5788 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Thu, 24 Sep 2020 15:23:35 +0200 Subject: [PATCH] build-manifest: add documentation on the PkgType methods --- src/tools/build-manifest/src/versions.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/build-manifest/src/versions.rs b/src/tools/build-manifest/src/versions.rs index 3b5caf1cd7b..9f37b22c494 100644 --- a/src/tools/build-manifest/src/versions.rs +++ b/src/tools/build-manifest/src/versions.rs @@ -38,6 +38,8 @@ pub(crate) fn from_component(component: &str) -> Self { } } + /// The directory containing the `Cargo.toml` of this component inside the monorepo, to + /// retrieve the source code version. If `None` is returned Rust's version will be used. fn rust_monorepo_path(&self) -> Option<&'static str> { match self { PkgType::Cargo => Some("src/tools/cargo"), @@ -53,6 +55,7 @@ fn rust_monorepo_path(&self) -> Option<&'static str> { } } + /// First part of the tarball name. fn tarball_component_name(&self) -> &str { match self { PkgType::Rust => "rust", @@ -68,6 +71,8 @@ fn tarball_component_name(&self) -> &str { } } + /// Whether this package has the same version as Rust itself, or has its own `version` and + /// `git-commit-hash` files inside the tarball. fn should_use_rust_version(&self) -> bool { match self { PkgType::Cargo => false, -- 2.44.0