From 355449fc6d5044f60496bd72871f0f4cadd92002 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 11 Nov 2020 20:38:32 +0100 Subject: [PATCH 1/6] bump MSRV to 1.40 --- .travis.yml | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c46a2c790..ede7d1f3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: required dist: trusty matrix: include: - - rust: 1.37.0 + - rust: 1.40.0 env: - FEATURES='test docs' - RUSTFLAGS='-D warnings' diff --git a/src/lib.rs b/src/lib.rs index 1b7590da1..5ea7e375b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,7 @@ //! needs matching memory layout to be efficient (with some exceptions). //! + Efficient floating point matrix multiplication even for very large //! matrices; can optionally use BLAS to improve it further. -//! - **Requires Rust 1.37 or later** +//! - **Requires Rust 1.40 or later** //! //! ## Crate Feature Flags //! From f9b8286c3472c01608e81dee7d100696cfaf48f2 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 11 Nov 2020 20:40:01 +0100 Subject: [PATCH 2/6] Marking ErrorKind enum as #[non_exhaustive] --- src/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/error.rs b/src/error.rs index 79acdd8b3..be7b1f9a5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -33,6 +33,7 @@ impl ShapeError { /// /// This enumeration is not exhaustive. The representation of the enum /// is not guaranteed. +#[non_exhaustive] #[derive(Copy, Clone, Debug)] pub enum ErrorKind { /// incompatible shape From 3e5d02d04ea6192833e1bc6df83371f0de73626c Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Wed, 11 Nov 2020 23:12:08 +0100 Subject: [PATCH 3/6] remove __Incomplete ErrorKind due to using #[non_exhaustive] --- src/error.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/error.rs b/src/error.rs index be7b1f9a5..090937561 100644 --- a/src/error.rs +++ b/src/error.rs @@ -48,8 +48,6 @@ pub enum ErrorKind { Unsupported, /// overflow when computing offset, length, etc. Overflow, - #[doc(hidden)] - __Incomplete, } #[inline(always)] @@ -82,7 +80,6 @@ impl fmt::Display for ShapeError { ErrorKind::OutOfBounds => "out of bounds indexing", ErrorKind::Unsupported => "unsupported operation", ErrorKind::Overflow => "arithmetic overflow", - ErrorKind::__Incomplete => "this error variant is not in use", }; write!(f, "ShapeError/{:?}: {}", self.kind(), description) } From 9a6f8b6693ad90520c7ce94a638d9f09160b36f9 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Thu, 12 Nov 2020 00:27:50 +0100 Subject: [PATCH 4/6] Following clippy lints --- src/slice.rs | 10 ++-------- src/stacking.rs | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/slice.rs b/src/slice.rs index 15765c61d..86a2b0b8f 100644 --- a/src/slice.rs +++ b/src/slice.rs @@ -110,18 +110,12 @@ copy_and_clone! {SliceOrIndex} impl SliceOrIndex { /// Returns `true` if `self` is a `Slice` value. pub fn is_slice(&self) -> bool { - match self { - SliceOrIndex::Slice { .. } => true, - _ => false, - } + matches!(self, SliceOrIndex::Slice { .. }) } /// Returns `true` if `self` is an `Index` value. pub fn is_index(&self) -> bool { - match self { - SliceOrIndex::Index(_) => true, - _ => false, - } + matches!(self, SliceOrIndex::Index(_)) } /// Returns a new `SliceOrIndex` with the given step size (multiplied with diff --git a/src/stacking.rs b/src/stacking.rs index 3e3b1afd8..3774aa083 100644 --- a/src/stacking.rs +++ b/src/stacking.rs @@ -165,7 +165,7 @@ where let mut res = Array::from_shape_vec(res_dim, v)?; res.axis_iter_mut(axis) - .zip(arrays.into_iter()) + .zip(arrays.iter()) .for_each(|(mut assign_view, array)| { assign_view.assign(&array); }); From 929e6997ef2efab208551462f2ff9f024cf74102 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Thu, 12 Nov 2020 02:08:50 +0100 Subject: [PATCH 5/6] Move MSRV to 1.42 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5ea7e375b..55b5a5080 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,7 @@ //! needs matching memory layout to be efficient (with some exceptions). //! + Efficient floating point matrix multiplication even for very large //! matrices; can optionally use BLAS to improve it further. -//! - **Requires Rust 1.40 or later** +//! - **Requires Rust 1.42 or later** //! //! ## Crate Feature Flags //! From 4f0cd9bbeea3077ba78f63d9fb2506e14c855c8b Mon Sep 17 00:00:00 2001 From: ZuseZ4 Date: Thu, 12 Nov 2020 06:16:23 +0100 Subject: [PATCH 6/6] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ede7d1f3b..f1dcd036a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: required dist: trusty matrix: include: - - rust: 1.40.0 + - rust: 1.42.0 env: - FEATURES='test docs' - RUSTFLAGS='-D warnings'