diff --git a/src/impl_methods.rs b/src/impl_methods.rs index 40c7fe1f2..7cc3c0be4 100644 --- a/src/impl_methods.rs +++ b/src/impl_methods.rs @@ -1771,8 +1771,9 @@ where /// broadcast them as array views into that shape. /// /// Return `ShapeError` if their shapes can not be broadcast together. + #[allow(clippy::type-complexity)] pub(crate) fn broadcast_with<'a, 'b, B, S2, E>(&'a self, other: &'b ArrayBase) -> - Result<(ArrayView<'a, A, >::Output>, ArrayView<'b, B, >::Output>), ShapeError> + Result<(ArrayView<'a, A, DimMaxOf>, ArrayView<'b, B, DimMaxOf>), ShapeError> where S: Data, S2: Data, @@ -1782,10 +1783,10 @@ where let shape = co_broadcast::>::Output>(&self.dim, &other.dim)?; if let Some(view1) = self.broadcast(shape.clone()) { if let Some(view2) = other.broadcast(shape) { - return Ok((view1, view2)) + return Ok((view1, view2)); } } - return Err(from_kind(ErrorKind::IncompatibleShape)); + Err(from_kind(ErrorKind::IncompatibleShape)) } /// Swap axes `ax` and `bx`. @@ -2465,3 +2466,5 @@ unsafe fn unlimited_transmute(data: A) -> B { let old_data = ManuallyDrop::new(data); (&*old_data as *const A as *const B).read() } + +type DimMaxOf = >::Output;