From f792b5f5684f85c4eabacd5be6292361a69c4d5f Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Mon, 14 Nov 2022 09:37:21 +0100 Subject: [PATCH] Deprecate MatrixSliceMutMN In the past, MatrixSliceMut did not have the same defaults. However, for a while now MatrixSliceMut has served the exact same purpose (in fact their definitions are identical), so we should deprecate MatrixSliceMutMN. --- src/base/alias_slice.rs | 1 + src/base/construction_slice.rs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/base/alias_slice.rs b/src/base/alias_slice.rs index d0fb6676..3fb5d793 100644 --- a/src/base/alias_slice.rs +++ b/src/base/alias_slice.rs @@ -371,6 +371,7 @@ pub type VectorSlice6<'a, T, RStride = U1, CStride = U6> = /// A column-major matrix slice with `R` rows and `C` columns. /// /// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.** +#[deprecated = "Use MatrixViewMut instead, which has an identical definition."] pub type MatrixSliceMutMN<'a, T, R, C, RStride = U1, CStride = R> = Matrix>; diff --git a/src/base/construction_slice.rs b/src/base/construction_slice.rs index d6a1f708..aa355264 100644 --- a/src/base/construction_slice.rs +++ b/src/base/construction_slice.rs @@ -1,6 +1,6 @@ use crate::base::dimension::{Const, Dim, DimName, Dynamic}; use crate::base::matrix_view::{ViewStorage, ViewStorageMut}; -use crate::base::{MatrixView, MatrixSliceMutMN, Scalar}; +use crate::base::{MatrixView, MatrixViewMut, Scalar}; use num_rational::Ratio; @@ -144,7 +144,7 @@ impl_constructors!(Dynamic, Dynamic; /// # Creating mutable matrix slices from `&mut [T]` impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> - MatrixSliceMutMN<'a, T, R, C, RStride, CStride> + MatrixViewMut<'a, T, R, C, RStride, CStride> { /// Creates, without bound-checking, a mutable matrix slice from an array and with dimensions and strides specified by generic types instances. /// @@ -217,7 +217,7 @@ impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> } } -impl<'a, T: Scalar, R: Dim, C: Dim> MatrixSliceMutMN<'a, T, R, C> { +impl<'a, T: Scalar, R: Dim, C: Dim> MatrixViewMut<'a, T, R, C> { /// Creates, without bound-checking, a mutable matrix slice from an array and with dimensions specified by generic types instances. /// /// # Safety @@ -247,7 +247,7 @@ impl<'a, T: Scalar, R: Dim, C: Dim> MatrixSliceMutMN<'a, T, R, C> { macro_rules! impl_constructors_mut( ($($Dims: ty),*; $(=> $DimIdent: ident: $DimBound: ident),*; $($gargs: expr),*; $($args: ident),*) => { - impl<'a, T: Scalar, $($DimIdent: $DimBound),*> MatrixSliceMutMN<'a, T, $($Dims),*> { + impl<'a, T: Scalar, $($DimIdent: $DimBound),*> MatrixViewMut<'a, T, $($Dims),*> { /// Creates a new mutable matrix slice from the given data array. /// /// Panics if `data` does not contain enough elements. @@ -263,7 +263,7 @@ macro_rules! impl_constructors_mut( } } - impl<'a, T: Scalar, $($DimIdent: $DimBound, )*> MatrixSliceMutMN<'a, T, $($Dims,)* Dynamic, Dynamic> { + impl<'a, T: Scalar, $($DimIdent: $DimBound, )*> MatrixViewMut<'a, T, $($Dims,)* Dynamic, Dynamic> { /// Creates a new mutable matrix slice with the specified strides from the given data array. /// /// Panics if `data` does not contain enough elements.