From aa4ae24adcde817c96111d83af80dc9721fe72aa Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 16 Nov 2023 13:05:28 -0800 Subject: [PATCH] Fix media table formatting (#2686) --- src/media.rs | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/media.rs b/src/media.rs index f54ac2b302..297ec3510c 100644 --- a/src/media.rs +++ b/src/media.rs @@ -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(