Skip to content

Commit

Permalink
Fix Clippy warning (#718)
Browse files Browse the repository at this point in the history
Rewrite `match` block using `matches` macro as it is now a
recommended way to perform such checks

(cherry picked from commit 2522a5d)

Signed-off-by: Alexei Lozovsky <alexei@cossacklabs.com>
  • Loading branch information
iamnotacake authored and ilammy committed Oct 17, 2020
1 parent 190383a commit cdb6506
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/wrappers/themis/rust/src/secure_comparator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,7 @@ impl SecureComparator {
/// assert!(!comparison.is_complete());
/// ```
pub fn is_complete(&self) -> bool {
match self.result() {
Err(ref e) if e.kind() == ErrorKind::CompareNotReady => false,
_ => true,
}
!matches!(self.result(), Err(ref e) if e.kind() == ErrorKind::CompareNotReady)
}

/// Returns the result of comparison.
Expand Down

0 comments on commit cdb6506

Please sign in to comment.