#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
pub enum OutputFormat {
#[default]
Pdf,
}
impl std::str::FromStr for OutputFormat {
type Err = String;
fn from_str(s: &str) -> Result<Self, String> {
match s {
"pdf" => Ok(OutputFormat::Pdf),
other => Err(format!(
"unknown --format {other:?} (expected pdf)"
)),
}
}
}
impl OutputFormat {
pub fn extension(self) -> &'static str {
match self {
OutputFormat::Pdf => "pdf",
}
}
pub(crate) fn cache_tag(self) -> &'static str {
match self {
OutputFormat::Pdf => "pdf",
}
}
}