Use matches!(..) to make TrieNode::is_empty more concise
This commit is contained in:
committed by
Chris Fallin
parent
66ba1d89b5
commit
5f5484ddbc
@@ -234,10 +234,7 @@ enum TrieNode {
|
|||||||
|
|
||||||
impl TrieNode {
|
impl TrieNode {
|
||||||
fn is_empty(&self) -> bool {
|
fn is_empty(&self) -> bool {
|
||||||
match self {
|
matches!(self, &TrieNode::Empty)
|
||||||
&TrieNode::Empty => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn insert(
|
fn insert(
|
||||||
|
|||||||
Reference in New Issue
Block a user