Skip to content

Commit ab7a613

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/impl_methods.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ where
17721772
///
17731773
/// Return `ShapeError` if their shapes can not be broadcast together.
17741774
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>
1775+
Result<(ArrayView<'a, A, DimMaxOf<D, E>>, ArrayView<'b, B, DimMaxOf<D, E>>), ShapeError>
17761776
where
17771777
S: Data<Elem=A>,
17781778
S2: Data<Elem=B>,
@@ -1782,10 +1782,10 @@ where
17821782
let shape = co_broadcast::<D, E, <D as DimMax<E>>::Output>(&self.dim, &other.dim)?;
17831783
if let Some(view1) = self.broadcast(shape.clone()) {
17841784
if let Some(view2) = other.broadcast(shape) {
1785-
return Ok((view1, view2))
1785+
return Ok((view1, view2));
17861786
}
17871787
}
1788-
return Err(from_kind(ErrorKind::IncompatibleShape));
1788+
Err(from_kind(ErrorKind::IncompatibleShape))
17891789
}
17901790

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

0 commit comments

Comments
 (0)