diff --git a/ruma-api-macros/Cargo.toml b/ruma-api-macros/Cargo.toml index 0cc553f0..477214f2 100644 --- a/ruma-api-macros/Cargo.toml +++ b/ruma-api-macros/Cargo.toml @@ -16,6 +16,7 @@ version = "0.16.1" edition = "2018" [dependencies] +matches = "0.1.8" proc-macro2 = "1.0.18" quote = "1.0.7" syn = { version = "1.0.31", features = ["full", "extra-traits"] } diff --git a/ruma-api-macros/src/api/response.rs b/ruma-api-macros/src/api/response.rs index 35a99d0f..78330717 100644 --- a/ruma-api-macros/src/api/response.rs +++ b/ruma-api-macros/src/api/response.rs @@ -2,6 +2,7 @@ use std::{convert::TryFrom, mem}; +use matches::matches; use proc_macro2::TokenStream; use quote::{quote, quote_spanned, ToTokens}; use syn::{spanned::Spanned, Field, Ident}; @@ -290,10 +291,7 @@ impl ResponseField { /// Whether or not this response field is a header kind. fn is_header(&self) -> bool { - match self { - ResponseField::Header(..) => true, - _ => false, - } + matches!(self, ResponseField::Header(..)) } /// Whether or not this response field is a newtype body kind.