Use matches! instead of manual match -> bool

This commit is contained in:
Jonas Platte 2020-07-15 12:21:23 +02:00
parent 60238bbb85
commit ded60cc935
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 3 additions and 4 deletions

View File

@ -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"] }

View File

@ -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.