compiler_llvm_builder/
ccache_variant.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
9pub enum CcacheVariant {
10 Ccache,
12 Sccache,
14}
15
16impl std::str::FromStr for CcacheVariant {
17 type Err = String;
18
19 fn from_str(value: &str) -> Result<Self, Self::Err> {
20 match value {
21 "ccache" => Ok(Self::Ccache),
22 "sccache" => Ok(Self::Sccache),
23 value => Err(format!("Unsupported ccache variant: `{}`", value)),
24 }
25 }
26}
27
28impl std::fmt::Display for CcacheVariant {
29 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
30 match self {
31 Self::Ccache => write!(f, "ccache"),
32 Self::Sccache => write!(f, "sccache"),
33 }
34 }
35}