From 6d4bfc3b7999cf75634be05b0f4f679fbfe13a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Fri, 2 Feb 2018 12:26:33 +0100 Subject: [PATCH] Fix warnings. --- src/core/construction.rs | 4 +--- src/core/construction_slice.rs | 27 ++++----------------------- src/core/ops.rs | 2 +- src/geometry/quaternion.rs | 2 +- src/lib.rs | 2 +- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/core/construction.rs b/src/core/construction.rs index 638a0ae2..e5c98025 100644 --- a/src/core/construction.rs +++ b/src/core/construction.rs @@ -10,12 +10,10 @@ use typenum::{self, Cmp, Greater}; use alga::general::{ClosedAdd, ClosedMul}; -use core::{DefaultAllocator, Scalar, Matrix, Vector, Unit, MatrixMN, MatrixN, VectorN, - MatrixSliceMN, MatrixSliceMutMN}; +use core::{DefaultAllocator, Scalar, Matrix, Vector, Unit, MatrixMN, MatrixN, VectorN}; use core::dimension::{Dim, DimName, Dynamic, U1, U2, U3, U4, U5, U6}; use core::allocator::Allocator; use core::storage::Storage; -use core::matrix_slice::{SliceStorage, SliceStorageMut}; /* * diff --git a/src/core/construction_slice.rs b/src/core/construction_slice.rs index 66f12cab..afb59c08 100644 --- a/src/core/construction_slice.rs +++ b/src/core/construction_slice.rs @@ -1,20 +1,5 @@ -#[cfg(feature = "arbitrary")] -use quickcheck::{Arbitrary, Gen}; -#[cfg(feature = "arbitrary")] -use core::storage::Owned; - -use std::iter; -use num::{Zero, One, Bounded}; -use rand::{self, Rand, Rng}; -use typenum::{self, Cmp, Greater}; - -use alga::general::{ClosedAdd, ClosedMul}; - -use core::{DefaultAllocator, Scalar, Matrix, Vector, Unit, MatrixMN, MatrixN, VectorN, - MatrixSliceMN, MatrixSliceMutMN}; -use core::dimension::{Dim, DimName, Dynamic, U1, U2, U3, U4, U5, U6}; -use core::allocator::Allocator; -use core::storage::Storage; +use core::{Scalar, MatrixSliceMN, MatrixSliceMutMN}; +use core::dimension::{Dim, DimName, Dynamic, U1}; use core::matrix_slice::{SliceStorage, SliceStorageMut}; /* @@ -26,9 +11,7 @@ impl<'a, N: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> MatrixSliceMN<'a #[inline] pub unsafe fn new_with_strides_generic_unchecked( data: &'a [N], start: usize, nrows: R, ncols: C, rstride: RStride, cstride: CStride) -> Self { - let data = unsafe { - SliceStorage::from_raw_parts(data.as_ptr().offset(start as isize), (nrows, ncols), (rstride, cstride)) - }; + let data = SliceStorage::from_raw_parts(data.as_ptr().offset(start as isize), (nrows, ncols), (rstride, cstride)); Self::from_data(data) } @@ -51,9 +34,7 @@ impl<'a, N: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> MatrixSliceMutMN #[inline] pub unsafe fn new_with_strides_generic_mut_unchecked( data: &'a mut [N], start: usize, nrows: R, ncols: C, rstride: RStride, cstride: CStride) -> Self { - let data = unsafe { - SliceStorageMut::from_raw_parts(data.as_mut_ptr().offset(start as isize), (nrows, ncols), (rstride, cstride)) - }; + let data = SliceStorageMut::from_raw_parts(data.as_mut_ptr().offset(start as isize), (nrows, ncols), (rstride, cstride)); Self::from_data(data) } diff --git a/src/core/ops.rs b/src/core/ops.rs index a1666d8d..f303e4d9 100644 --- a/src/core/ops.rs +++ b/src/core/ops.rs @@ -6,7 +6,7 @@ use num::{Zero, One, Signed}; use alga::general::{ClosedMul, ClosedDiv, ClosedAdd, ClosedSub, ClosedNeg}; -use core::{DefaultAllocator, Scalar, Matrix, MatrixN, MatrixMN, MatrixSum, SquareMatrix}; +use core::{DefaultAllocator, Scalar, Matrix, MatrixN, MatrixMN, MatrixSum}; use core::dimension::{Dim, DimName, DimProd, DimMul}; use core::constraint::{ShapeConstraint, SameNumberOfRows, SameNumberOfColumns, AreMultipliable, DimEq}; use core::storage::{Storage, StorageMut, ContiguousStorageMut}; diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 0e9f4d63..9572390d 100644 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -13,7 +13,7 @@ use abomonation::Abomonation; use alga::general::Real; -use core::{Unit, Vector3, Vector4, MatrixSlice, MatrixSliceMut, SquareMatrix, MatrixN, Matrix3}; +use core::{Unit, Vector3, Vector4, MatrixSlice, MatrixSliceMut, MatrixN, Matrix3}; use core::dimension::{U1, U3, U4}; use core::storage::{RStride, CStride}; diff --git a/src/lib.rs b/src/lib.rs index b285819c..79e805c6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -85,7 +85,7 @@ an optimized set of tools for computer graphics and physics. Those features incl #![deny(non_upper_case_globals)] #![deny(unused_qualifications)] #![deny(unused_results)] -#![warn(missing_docs)] +// #![warn(missing_docs)] #![doc(html_root_url = "http://nalgebra.org/rustdoc")] #[cfg(feature = "arbitrary")]