forked from rust-lang/rust
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build-manifest: move PkgType into the versions module
- Loading branch information
1 parent
b9af3e3
commit 0917b21
Showing
2 changed files
with
31 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pub(crate) enum PkgType { | ||
RustSrc, | ||
Cargo, | ||
Rls, | ||
RustAnalyzer, | ||
Clippy, | ||
Rustfmt, | ||
LlvmTools, | ||
Miri, | ||
Other(String), | ||
} | ||
|
||
impl PkgType { | ||
pub(crate) fn from_component(component: &str) -> Self { | ||
match component { | ||
"rust-src" => PkgType::RustSrc, | ||
"cargo" => PkgType::Cargo, | ||
"rls" | "rls-preview" => PkgType::Rls, | ||
"rust-analyzer" | "rust-analyzer-preview" => PkgType::RustAnalyzer, | ||
"clippy" | "clippy-preview" => PkgType::Clippy, | ||
"rustfmt" | "rustfmt-preview" => PkgType::Rustfmt, | ||
"llvm-tools" | "llvm-tools-preview" => PkgType::LlvmTools, | ||
"miri" | "miri-preview" => PkgType::Miri, | ||
other => PkgType::Other(other.into()), | ||
} | ||
} | ||
} |