Skip to content

Commit

Permalink
cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Mar 11, 2024
1 parent d0851f6 commit a898478
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,10 @@ where

fn approx_eq<M: Into<Self::Margin>>(self, other: Self, margin: M) -> bool {
let margin = margin.into();
if self.is_none() && other.is_none() {
return true;
}
if self.is_some() && other.is_some() {
return self
.as_ref()
.unwrap()
.approx_eq(*other.as_ref().unwrap(), margin);
} else {
return false;
match (self, other) {
(None, None) => true,
(Some(slf), Some(oth)) => slf.approx_eq(oth, margin),
_ => false,
}
}
}
Expand Down

0 comments on commit a898478

Please sign in to comment.