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"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
matches = "0.1.8"
|
||||||
proc-macro2 = "1.0.18"
|
proc-macro2 = "1.0.18"
|
||||||
quote = "1.0.7"
|
quote = "1.0.7"
|
||||||
syn = { version = "1.0.31", features = ["full", "extra-traits"] }
|
syn = { version = "1.0.31", features = ["full", "extra-traits"] }
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use std::{convert::TryFrom, mem};
|
use std::{convert::TryFrom, mem};
|
||||||
|
|
||||||
|
use matches::matches;
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
use quote::{quote, quote_spanned, ToTokens};
|
use quote::{quote, quote_spanned, ToTokens};
|
||||||
use syn::{spanned::Spanned, Field, Ident};
|
use syn::{spanned::Spanned, Field, Ident};
|
||||||
@ -290,10 +291,7 @@ impl ResponseField {
|
|||||||
|
|
||||||
/// Whether or not this response field is a header kind.
|
/// Whether or not this response field is a header kind.
|
||||||
fn is_header(&self) -> bool {
|
fn is_header(&self) -> bool {
|
||||||
match self {
|
matches!(self, ResponseField::Header(..))
|
||||||
ResponseField::Header(..) => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether or not this response field is a newtype body kind.
|
/// Whether or not this response field is a newtype body kind.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user