]> git.lizzy.rs Git - rust.git/commitdiff
build-manifest: add documentation on the PkgType methods
authorPietro Albini <pietro@pietroalbini.org>
Thu, 24 Sep 2020 13:23:35 +0000 (15:23 +0200)
committerPietro Albini <pietro@pietroalbini.org>
Thu, 24 Sep 2020 17:26:43 +0000 (19:26 +0200)
src/tools/build-manifest/src/versions.rs

index 3b5caf1cd7b91007fe2d62e79d2826e046d2524d..9f37b22c4941d070ead90a20c6cb2bd0b333841a 100644 (file)
@@ -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,