diff --git a/.travis.yml b/.travis.yml index c46a2c790..f1dcd036a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: required dist: trusty matrix: include: - - rust: 1.37.0 + - rust: 1.42.0 env: - FEATURES='test docs' - RUSTFLAGS='-D warnings' diff --git a/src/error.rs b/src/error.rs index 79acdd8b3..090937561 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 @@ -47,8 +48,6 @@ pub enum ErrorKind { Unsupported, /// overflow when computing offset, length, etc. Overflow, - #[doc(hidden)] - __Incomplete, } #[inline(always)] @@ -81,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) } diff --git a/src/lib.rs b/src/lib.rs index 1b7590da1..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.37 or later** +//! - **Requires Rust 1.42 or later** //! //! ## Crate Feature Flags //! 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); });