Skip to content

Commit

Permalink
build-manifest: add documentation on the PkgType methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Sep 24, 2020
1 parent 6b233ea commit bb8430e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tools/build-manifest/src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ impl PkgType {
}
}

/// 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"),
Expand All @@ -53,6 +55,7 @@ impl PkgType {
}
}

/// First part of the tarball name.
fn tarball_component_name(&self) -> &str {
match self {
PkgType::Rust => "rust",
Expand All @@ -68,6 +71,8 @@ impl PkgType {
}
}

/// 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,
Expand Down

0 comments on commit bb8430e

Please sign in to comment.