Skip to content

Commit

Permalink
Remove pre_release in version info.
Browse files Browse the repository at this point in the history
This field is no longer being used, as pre-release versions have
not been used in cargo for quite some time, and I don't anticipate
them ever returning.
  • Loading branch information
ehuss committed Dec 6, 2021
1 parent 6758105 commit f5cb79e
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/cargo/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub struct VersionInfo {
pub major: u8,
pub minor: u8,
pub patch: u8,
pub pre_release: Option<String>,
/// Information that's only available when we were built with
/// rustbuild, rather than Cargo itself.
pub cfg_info: Option<CfgInfo>,
Expand All @@ -34,8 +33,6 @@ impl fmt::Display for VersionInfo {
if let Some(channel) = self.cfg_info.as_ref().map(|ci| &ci.release_channel) {
if channel != "stable" {
write!(f, "-{}", channel)?;
let empty = String::new();
write!(f, "{}", self.pre_release.as_ref().unwrap_or(&empty))?;
}
};

Expand Down Expand Up @@ -86,7 +83,6 @@ pub fn version() -> VersionInfo {
major,
minor,
patch,
pre_release: option_env_str!("CARGO_PKG_VERSION_PRE"),
cfg_info: Some(CfgInfo {
release_channel: option_env_str!("CFG_RELEASE_CHANNEL").unwrap(),
commit_info,
Expand All @@ -98,7 +94,6 @@ pub fn version() -> VersionInfo {
major,
minor,
patch,
pre_release: option_env_str!("CARGO_PKG_VERSION_PRE"),
cfg_info: None,
},
}
Expand Down

0 comments on commit f5cb79e

Please sign in to comment.