Skip to content

Commit 0c3f2ef

Browse files
committed
Fix clippy::collapsible_else_if
1 parent 91b818c commit 0c3f2ef

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,11 @@ impl<T: Float> Complex<T> {
213213
if !im.is_finite() {
214214
return Self::new(T::zero(), T::zero());
215215
}
216-
} else {
217-
if im == T::zero() || !im.is_finite() {
218-
if im.is_infinite() {
219-
im = T::nan();
220-
}
221-
return Self::new(re, im);
216+
} else if im == T::zero() || !im.is_finite() {
217+
if im.is_infinite() {
218+
im = T::nan();
222219
}
220+
return Self::new(re, im);
223221
}
224222
} else if re.is_nan() && im == T::zero() {
225223
return self;

0 commit comments

Comments
 (0)