Skip to content

Commit 1ddf2b2

Browse files
committedOct 5, 2020
Replaced is_inserted implementation of State with matches! macro to improve code readability
1 parent fd1f32d commit 1ddf2b2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
 

‎src/replace.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ enum State {
1414

1515
impl State {
1616
fn is_inserted(&self) -> bool {
17-
if let State::Inserted(..) = *self {
18-
true
19-
} else {
20-
false
21-
}
17+
matches!(*self, State::Inserted(..))
2218
}
2319
}
2420

0 commit comments

Comments
 (0)
Please sign in to comment.