fix clippy lint match|if let looks like matches! macro
This commit is contained in:
@@ -187,10 +187,7 @@ impl RegType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_perm(self) -> bool {
|
pub fn is_perm(self) -> bool {
|
||||||
match self {
|
matches!(self, RegType::Perm(_))
|
||||||
RegType::Perm(_) => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,27 +302,15 @@ pub enum DoubleQuotes {
|
|||||||
|
|
||||||
impl DoubleQuotes {
|
impl DoubleQuotes {
|
||||||
pub fn is_chars(self) -> bool {
|
pub fn is_chars(self) -> bool {
|
||||||
if let DoubleQuotes::Chars = self {
|
matches!(self, DoubleQuotes::Chars)
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_atom(self) -> bool {
|
pub fn is_atom(self) -> bool {
|
||||||
if let DoubleQuotes::Atom = self {
|
matches!(self, DoubleQuotes::Atom)
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_codes(self) -> bool {
|
pub fn is_codes(self) -> bool {
|
||||||
if let DoubleQuotes::Codes = self {
|
matches!(self, DoubleQuotes::Codes)
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,11 +659,7 @@ impl ClauseName {
|
|||||||
pub fn has_table_of(&self, other: &ClauseName) -> bool {
|
pub fn has_table_of(&self, other: &ClauseName) -> bool {
|
||||||
match self {
|
match self {
|
||||||
ClauseName::BuiltIn(_) => {
|
ClauseName::BuiltIn(_) => {
|
||||||
if let ClauseName::BuiltIn(_) = other {
|
matches!(other, ClauseName::BuiltIn(_))
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ClauseName::User(ref name) => other.has_table(&name.table),
|
ClauseName::User(ref name) => other.has_table(&name.table),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,18 +28,18 @@ enum TokenType {
|
|||||||
|
|
||||||
impl TokenType {
|
impl TokenType {
|
||||||
fn is_sep(self) -> bool {
|
fn is_sep(self) -> bool {
|
||||||
match self {
|
matches!(
|
||||||
|
self,
|
||||||
TokenType::HeadTailSeparator
|
TokenType::HeadTailSeparator
|
||||||
| TokenType::OpenCT
|
| TokenType::OpenCT
|
||||||
| TokenType::Open
|
| TokenType::Open
|
||||||
| TokenType::Close
|
| TokenType::Close
|
||||||
| TokenType::OpenList
|
| TokenType::OpenList
|
||||||
| TokenType::CloseList
|
| TokenType::CloseList
|
||||||
| TokenType::OpenCurly
|
| TokenType::OpenCurly
|
||||||
| TokenType::CloseCurly
|
| TokenType::CloseCurly
|
||||||
| TokenType::Comma => true,
|
| TokenType::Comma
|
||||||
_ => false,
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user