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