Skip to content

Commit a3dd94e

Browse files
committed
Use PkgType::is_preview to determine whether to add a rename to the manifest
This caught a missing preview rename for `llvm-tools`.
1 parent 69a7495 commit a3dd94e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,11 @@ impl Builder {
365365
let mut rename = |from: &str, to: &str| {
366366
manifest.renames.insert(from.to_owned(), Rename { to: to.to_owned() })
367367
};
368-
rename("rls", "rls-preview");
369-
rename("rustfmt", "rustfmt-preview");
370-
rename("clippy", "clippy-preview");
371-
rename("miri", "miri-preview");
372-
rename("rust-docs-json", "rust-docs-json-preview");
373-
rename("rust-analyzer", "rust-analyzer-preview");
368+
for pkg in PkgType::all() {
369+
if pkg.is_preview() {
370+
rename(pkg.tarball_component_name(), &pkg.manifest_component_name());
371+
}
372+
}
374373
}
375374

376375
fn rust_package(&mut self, manifest: &Manifest) -> Package {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ macro_rules! pkg_type {
1717
}
1818

1919
impl PkgType {
20-
fn is_preview(&self) -> bool {
20+
pub(crate) fn is_preview(&self) -> bool {
2121
match self {
2222
$( $( $($is_preview)? PkgType::$variant => true, )? )+
2323
_ => false,
@@ -32,7 +32,7 @@ macro_rules! pkg_type {
3232
}
3333

3434
/// First part of the tarball name.
35-
fn tarball_component_name(&self) -> &str {
35+
pub(crate) fn tarball_component_name(&self) -> &str {
3636
match self {
3737
$( PkgType::$variant => $component,)+
3838
PkgType::Other(component) => component,

0 commit comments

Comments
 (0)