made nicer error

This commit is contained in:
faldor20 2024-01-07 11:28:05 +10:00
parent 124abc3620
commit f36befdd4c
3 changed files with 55 additions and 18 deletions

View file

@ -23,6 +23,16 @@ impl<'a> HeaderType<'a> {
HeaderType::Platform { .. } | HeaderType::Package { .. } => &[],
}
}
pub fn to_string(&'a self) -> &str {
match self {
HeaderType::App { .. } => "app",
HeaderType::Hosted { .. } => "hosted",
HeaderType::Builtin { .. } => "builtin",
HeaderType::Package { .. } => "package",
HeaderType::Platform { .. } => "platform",
HeaderType::Interface { .. } => "interface",
}
}
}
#[derive(Debug)]