Use matches! instead of manual match
-> bool
This commit is contained in:
parent
60238bbb85
commit
ded60cc935
@ -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"] }
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user