Skip to content

Commit

Permalink
build-manifest: strip newline from rustc version
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Nov 16, 2020
1 parent f5230fb commit 32d3146
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tools/build-manifest/src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
use tar::Archive;

const DEFAULT_TARGET: &str = "x86_64-unknown-linux-gnu";
const RUSTC_VERSION: &str = include_str!("../../../version");

#[derive(Debug, Hash, Eq, PartialEq, Clone)]
pub(crate) enum PkgType {
Expand Down Expand Up @@ -177,10 +176,10 @@ impl Versions {
) -> Result<String, Error> {
let component_name = package.tarball_component_name();
let version = match self.channel.as_str() {
"stable" => RUSTC_VERSION.into(),
"stable" => self.rustc_version().into(),
"beta" => "beta".into(),
"nightly" => "nightly".into(),
_ => format!("{}-dev", RUSTC_VERSION),
_ => format!("{}-dev", self.rustc_version()),
};

if package.target_independent() {
Expand All @@ -199,6 +198,7 @@ impl Versions {
}

pub(crate) fn rustc_version(&self) -> &str {
RUSTC_VERSION
const RUSTC_VERSION: &str = include_str!("../../../version");
RUSTC_VERSION.trim()
}
}

0 comments on commit 32d3146

Please sign in to comment.