Archived
3
0
This repository has been archived on 2025-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zmp24-docs/src/mime_types.rs
2025-03-09 20:00:18 +01:00

21 lines
372 B
Rust

macro_rules! mimes {
($($ident: ident = $value: literal),*$(,)?) => {
pub enum MimeType {
$($ident),*
}
impl MimeType {
pub fn text(&self) -> &'static str {
match self { $(Self::$ident => $value),* }
}
}
};
}
mimes! {
Txt = "text/plain",
Html = "text/html",
Css = "text/css",
Js = "text/javascript",
}