Create build system (#1)
This commit is contained in:
20
src/mime_types.rs
Normal file
20
src/mime_types.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
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",
|
||||
}
|
Reference in New Issue
Block a user