Skip to content

Commit

Permalink
Revert "Fix clippy: match expr looks like matches! macro"
Browse files Browse the repository at this point in the history
This reverts commit 91fc873.

The matches! macro was only stabilized in 1.42. Reverting in order to
avoid breaking older code.
  • Loading branch information
dcroote committed Jan 26, 2021
1 parent 40933e5 commit 52f7873
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/strand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ impl Strand {
impl PartialEq for Strand {
/// Returns true if both are `Forward` or both are `Reverse`, otherwise returns false.
fn eq(&self, other: &Strand) -> bool {
matches!(
(self, other),
(&Strand::Forward, &Strand::Forward) | (&Strand::Reverse, &Strand::Reverse)
)
match (self, other) {
(&Strand::Forward, &Strand::Forward) => true,
(&Strand::Reverse, &Strand::Reverse) => true,
_ => false,
}
}
}

Expand All @@ -73,12 +74,12 @@ impl Neg for Strand {

impl Same for Strand {
fn same(&self, s1: &Self) -> bool {
matches!(
(*self, *s1),
(Strand::Forward, Strand::Forward)
| (Strand::Reverse, Strand::Reverse)
| (Strand::Unknown, Strand::Unknown)
)
match (*self, *s1) {
(Strand::Forward, Strand::Forward) => true,
(Strand::Reverse, Strand::Reverse) => true,
(Strand::Unknown, Strand::Unknown) => true,
_ => false,
}
}
}

Expand Down

0 comments on commit 52f7873

Please sign in to comment.