Skip to content

Commit 03cfdfc

Browse files
committed
MAINT: Fix clippy warnings for broadcast_with
1 parent 38f7341 commit 03cfdfc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/impl_methods.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1771,8 +1771,9 @@ where
17711771
/// broadcast them as array views into that shape.
17721772
///
17731773
/// Return `ShapeError` if their shapes can not be broadcast together.
1774+
#[allow(clippy::type_complexity)]
17741775
pub(crate) fn broadcast_with<'a, 'b, B, S2, E>(&'a self, other: &'b ArrayBase<S2, E>) ->
1775-
Result<(ArrayView<'a, A, <D as DimMax<E>>::Output>, ArrayView<'b, B, <D as DimMax<E>>::Output>), ShapeError>
1776+
Result<(ArrayView<'a, A, DimMaxOf<D, E>>, ArrayView<'b, B, DimMaxOf<D, E>>), ShapeError>
17761777
where
17771778
S: Data<Elem=A>,
17781779
S2: Data<Elem=B>,
@@ -1782,10 +1783,10 @@ where
17821783
let shape = co_broadcast::<D, E, <D as DimMax<E>>::Output>(&self.dim, &other.dim)?;
17831784
if let Some(view1) = self.broadcast(shape.clone()) {
17841785
if let Some(view2) = other.broadcast(shape) {
1785-
return Ok((view1, view2))
1786+
return Ok((view1, view2));
17861787
}
17871788
}
1788-
return Err(from_kind(ErrorKind::IncompatibleShape));
1789+
Err(from_kind(ErrorKind::IncompatibleShape))
17891790
}
17901791

17911792
/// Swap axes `ax` and `bx`.
@@ -2465,3 +2466,5 @@ unsafe fn unlimited_transmute<A, B>(data: A) -> B {
24652466
let old_data = ManuallyDrop::new(data);
24662467
(&*old_data as *const A as *const B).read()
24672468
}
2469+
2470+
type DimMaxOf<A, B> = <A as DimMax<B>>::Output;

0 commit comments

Comments
 (0)