mirror of https://github.com/rwf2/Rocket.git
Enforce trailing commas in 'known' macros.
This commit is contained in:
parent
6de76c51bc
commit
8b1aaed0ce
|
@ -147,7 +147,7 @@ pub struct Accept(AcceptParams);
|
|||
|
||||
macro_rules! accept_constructor {
|
||||
($($name:ident ($check:ident): $str:expr, $t:expr,
|
||||
$s:expr $(; $k:expr => $v:expr)*),+) => {
|
||||
$s:expr $(; $k:expr => $v:expr)*,)+) => {
|
||||
$(
|
||||
#[doc="An `Accept` header with the single media type for <b>"]
|
||||
#[doc=$str] #[doc="</b>: <i>"]
|
||||
|
|
|
@ -44,7 +44,7 @@ pub struct ContentType(pub MediaType);
|
|||
|
||||
macro_rules! content_types {
|
||||
($($name:ident ($check:ident): $str:expr, $t:expr,
|
||||
$s:expr $(; $k:expr => $v:expr)*),+) => {
|
||||
$s:expr $(; $k:expr => $v:expr)*,)+) => {
|
||||
$(
|
||||
#[doc="Content-Type for <b>"] #[doc=$str] #[doc="</b>: <i>"]
|
||||
#[doc=$t] #[doc="/"] #[doc=$s]
|
||||
|
|
|
@ -23,7 +23,7 @@ macro_rules! known_media_types {
|
|||
OTF (is_otf): "OTF", "application", "font-sfnt",
|
||||
WOFF (is_woff): "WOFF", "application", "font-woff",
|
||||
WOFF2 (is_woff2): "WOFF2", "font", "woff2",
|
||||
JsonApi (is_json_api): "JSON API", "application", "vnd.api+json"
|
||||
JsonApi (is_json_api): "JSON API", "application", "vnd.api+json",
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,6 @@ macro_rules! known_extensions {
|
|||
"ttf" => TTF,
|
||||
"otf" => OTF,
|
||||
"woff" => WOFF,
|
||||
"woff2" => WOFF2
|
||||
"woff2" => WOFF2,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ macro_rules! media_str {
|
|||
|
||||
macro_rules! media_types {
|
||||
($($name:ident ($check:ident): $str:expr, $t:expr,
|
||||
$s:expr $(; $k:expr => $v:expr)*),+) => {
|
||||
$s:expr $(; $k:expr => $v:expr)*,)+) => {
|
||||
$(
|
||||
#[doc="Media type for <b>"] #[doc=$str] #[doc="</b>: <i>"]
|
||||
#[doc=$t] #[doc="/"] #[doc=$s]
|
||||
|
@ -139,7 +139,7 @@ macro_rules! media_types {
|
|||
}
|
||||
|
||||
macro_rules! from_extension {
|
||||
($($ext:expr => $name:ident),*) => (
|
||||
($($ext:expr => $name:ident,)*) => (
|
||||
/// Returns the Media-Type associated with the extension `ext`. Not all
|
||||
/// extensions are recognized. If an extensions is not recognized,
|
||||
/// `None` is returned. The currently recognized extensions are
|
||||
|
|
Loading…
Reference in New Issue