Skip to content

Commit

Permalink
Fix clippy::collapsible_else_if
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Feb 8, 2024
1 parent 91b818c commit 0c3f2ef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib.rs
Expand Up @@ -213,13 +213,11 @@ impl<T: Float> Complex<T> {
if !im.is_finite() {
return Self::new(T::zero(), T::zero());
}
} else {
if im == T::zero() || !im.is_finite() {
if im.is_infinite() {
im = T::nan();
}
return Self::new(re, im);
} else if im == T::zero() || !im.is_finite() {
if im.is_infinite() {
im = T::nan();
}
return Self::new(re, im);
}
} else if re.is_nan() && im == T::zero() {
return self;
Expand Down

0 comments on commit 0c3f2ef

Please sign in to comment.