From ab7a6139a5e86271b98333ba6e319ad82ad5fa2e Mon Sep 17 00:00:00 2001 From: bluss Date: Fri, 12 Mar 2021 11:50:11 +0100 Subject: [PATCH] MAINT: Fix clippy warnings for broadcast_with --- src/impl_methods.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/impl_methods.rs b/src/impl_methods.rs index 40c7fe1f2..234c889f1 100644 --- a/src/impl_methods.rs +++ b/src/impl_methods.rs @@ -1772,7 +1772,7 @@ where /// /// Return `ShapeError` if their shapes can not be broadcast together. 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 +1782,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 +2465,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;