Skip to content

Commit

Permalink
Fix media table formatting (#2686)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Nov 16, 2023
1 parent ab047f7 commit aa4ae24
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions src/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,40 @@ pub(crate) enum Media {
impl Media {
#[rustfmt::skip]
const TABLE: &'static [(&'static str, BrotliEncoderMode, Media, &'static [&'static str])] = &[
("application/cbor", BROTLI_MODE_GENERIC, Media::Unknown, &["cbor"]),
("application/json", BROTLI_MODE_TEXT, Media::Code, &["json"]),
("application/pdf", BROTLI_MODE_GENERIC, Media::Pdf, &["pdf"]),
("application/pgp-signature", BROTLI_MODE_TEXT, Media::Text, &["asc"]),
("application/protobuf", BROTLI_MODE_GENERIC, Media::Unknown, &["binpb"]),
("application/yaml", BROTLI_MODE_TEXT, Media::Code, &["yaml", "yml"]),
("audio/flac", BROTLI_MODE_GENERIC, Media::Audio, &["flac"]),
("audio/mpeg", BROTLI_MODE_GENERIC, Media::Audio, &["mp3"]),
("audio/wav", BROTLI_MODE_GENERIC, Media::Audio, &["wav"]),
("font/otf", BROTLI_MODE_GENERIC, Media::Unknown, &["otf"]),
("font/ttf", BROTLI_MODE_GENERIC, Media::Unknown, &["ttf"]),
("font/woff", BROTLI_MODE_GENERIC, Media::Unknown, &["woff"]),
("font/woff2", BROTLI_MODE_FONT, Media::Unknown, &["woff2"]),
("image/apng", BROTLI_MODE_GENERIC, Media::Image, &["apng"]),
("image/avif", BROTLI_MODE_GENERIC, Media::Image, &[]),
("image/gif", BROTLI_MODE_GENERIC, Media::Image, &["gif"]),
("image/jpeg", BROTLI_MODE_GENERIC, Media::Image, &["jpg", "jpeg"]),
("image/png", BROTLI_MODE_GENERIC, Media::Image, &["png"]),
("image/svg+xml", BROTLI_MODE_TEXT, Media::Iframe, &["svg"]),
("image/webp", BROTLI_MODE_GENERIC, Media::Image, &["webp"]),
("model/gltf+json", BROTLI_MODE_TEXT, Media::Model, &["gltf"]),
("model/gltf-binary", BROTLI_MODE_GENERIC, Media::Model, &["glb"]),
("model/stl", BROTLI_MODE_GENERIC, Media::Unknown, &["stl"]),
("text/css", BROTLI_MODE_TEXT, Media::Code, &["css"]),
("text/html", BROTLI_MODE_TEXT, Media::Iframe, &[]),
("text/html;charset=utf-8", BROTLI_MODE_TEXT, Media::Iframe, &["html"]),
("text/javascript", BROTLI_MODE_TEXT, Media::Code, &["js"]),
("text/markdown", BROTLI_MODE_TEXT, Media::Markdown, &[]),
("text/markdown;charset=utf-8", BROTLI_MODE_TEXT, Media::Markdown, &["md"]),
("text/plain", BROTLI_MODE_TEXT, Media::Text, &[]),
("text/plain;charset=utf-8", BROTLI_MODE_TEXT, Media::Text, &["txt"]),
("text/x-python", BROTLI_MODE_TEXT, Media::Code, &["py"]),
("video/mp4", BROTLI_MODE_GENERIC, Media::Video, &["mp4"]),
("video/webm", BROTLI_MODE_GENERIC, Media::Video, &["webm"]),
("application/cbor", BROTLI_MODE_GENERIC, Media::Unknown, &["cbor"]),
("application/json", BROTLI_MODE_TEXT, Media::Code, &["json"]),
("application/pdf", BROTLI_MODE_GENERIC, Media::Pdf, &["pdf"]),
("application/pgp-signature", BROTLI_MODE_TEXT, Media::Text, &["asc"]),
("application/protobuf", BROTLI_MODE_GENERIC, Media::Unknown, &["binpb"]),
("application/yaml", BROTLI_MODE_TEXT, Media::Code, &["yaml", "yml"]),
("audio/flac", BROTLI_MODE_GENERIC, Media::Audio, &["flac"]),
("audio/mpeg", BROTLI_MODE_GENERIC, Media::Audio, &["mp3"]),
("audio/wav", BROTLI_MODE_GENERIC, Media::Audio, &["wav"]),
("font/otf", BROTLI_MODE_GENERIC, Media::Unknown, &["otf"]),
("font/ttf", BROTLI_MODE_GENERIC, Media::Unknown, &["ttf"]),
("font/woff", BROTLI_MODE_GENERIC, Media::Unknown, &["woff"]),
("font/woff2", BROTLI_MODE_FONT, Media::Unknown, &["woff2"]),
("image/apng", BROTLI_MODE_GENERIC, Media::Image, &["apng"]),
("image/avif", BROTLI_MODE_GENERIC, Media::Image, &[]),
("image/gif", BROTLI_MODE_GENERIC, Media::Image, &["gif"]),
("image/jpeg", BROTLI_MODE_GENERIC, Media::Image, &["jpg", "jpeg"]),
("image/png", BROTLI_MODE_GENERIC, Media::Image, &["png"]),
("image/svg+xml", BROTLI_MODE_TEXT, Media::Iframe, &["svg"]),
("image/webp", BROTLI_MODE_GENERIC, Media::Image, &["webp"]),
("model/gltf+json", BROTLI_MODE_TEXT, Media::Model, &["gltf"]),
("model/gltf-binary", BROTLI_MODE_GENERIC, Media::Model, &["glb"]),
("model/stl", BROTLI_MODE_GENERIC, Media::Unknown, &["stl"]),
("text/css", BROTLI_MODE_TEXT, Media::Code, &["css"]),
("text/html", BROTLI_MODE_TEXT, Media::Iframe, &[]),
("text/html;charset=utf-8", BROTLI_MODE_TEXT, Media::Iframe, &["html"]),
("text/javascript", BROTLI_MODE_TEXT, Media::Code, &["js"]),
("text/markdown", BROTLI_MODE_TEXT, Media::Markdown, &[]),
("text/markdown;charset=utf-8", BROTLI_MODE_TEXT, Media::Markdown, &["md"]),
("text/plain", BROTLI_MODE_TEXT, Media::Text, &[]),
("text/plain;charset=utf-8", BROTLI_MODE_TEXT, Media::Text, &["txt"]),
("text/x-python", BROTLI_MODE_TEXT, Media::Code, &["py"]),
("video/mp4", BROTLI_MODE_GENERIC, Media::Video, &["mp4"]),
("video/webm", BROTLI_MODE_GENERIC, Media::Video, &["webm"]),
];

pub(crate) fn content_type_for_path(
Expand Down

0 comments on commit aa4ae24

Please sign in to comment.