diff options
Diffstat (limited to 'rustc_tools_util/src/lib.rs')
| -rw-r--r-- | rustc_tools_util/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/rustc_tools_util/src/lib.rs b/rustc_tools_util/src/lib.rs index 92b710614ec..36b58a398dc 100644 --- a/rustc_tools_util/src/lib.rs +++ b/rustc_tools_util/src/lib.rs @@ -79,6 +79,7 @@ impl std::fmt::Debug for VersionInfo { } } +#[must_use] pub fn get_commit_hash() -> Option<String> { std::process::Command::new("git") .args(&["rev-parse", "--short", "HEAD"]) @@ -87,6 +88,7 @@ pub fn get_commit_hash() -> Option<String> { .and_then(|r| String::from_utf8(r.stdout).ok()) } +#[must_use] pub fn get_commit_date() -> Option<String> { std::process::Command::new("git") .args(&["log", "-1", "--date=short", "--pretty=format:%cd"]) @@ -95,6 +97,7 @@ pub fn get_commit_date() -> Option<String> { .and_then(|r| String::from_utf8(r.stdout).ok()) } +#[must_use] pub fn get_channel() -> Option<String> { match env::var("CFG_RELEASE_CHANNEL") { Ok(channel) => Some(channel), |
