Skip to content

Commit 32d3146

Browse files
committed
build-manifest: strip newline from rustc version
1 parent f5230fb commit 32d3146

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/build-manifest/src/versions.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
77
use tar::Archive;
88

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

1211
#[derive(Debug, Hash, Eq, PartialEq, Clone)]
1312
pub(crate) enum PkgType {
@@ -177,10 +176,10 @@ impl Versions {
177176
) -> Result<String, Error> {
178177
let component_name = package.tarball_component_name();
179178
let version = match self.channel.as_str() {
180-
"stable" => RUSTC_VERSION.into(),
179+
"stable" => self.rustc_version().into(),
181180
"beta" => "beta".into(),
182181
"nightly" => "nightly".into(),
183-
_ => format!("{}-dev", RUSTC_VERSION),
182+
_ => format!("{}-dev", self.rustc_version()),
184183
};
185184

186185
if package.target_independent() {
@@ -199,6 +198,7 @@ impl Versions {
199198
}
200199

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

0 commit comments

Comments
 (0)