Remove the Deref implementation for MatrixRef.

Fix #380.
This commit is contained in:
sebcrozet 2018-09-13 05:45:14 +02:00
parent 21c163db3a
commit 664658760a
2 changed files with 12 additions and 12 deletions

View File

@ -35,6 +35,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
* Implement `Extend<Matrix<...>>` for matrices with dynamic storage. This will concatenate the columns of both matrices.
* Implement `Into<Vec>` for the `MatrixVec` storage.
* Implement `Hash` for all matrices.
* Add a `.len()` method to retrieve the size of a `MatrixVec`.
### Modified
* The orthographic projection no longer require that `bottom < top`, that `left < right`, and that `znear < zfar`. The
@ -47,6 +48,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This is for the case of `Unit`, `Transform`, `Orthographic3`, `Perspective3`, `Rotation`.
* Deprecate several functions at the root of the crate (replaced by methods).
### Removed
* Remove the `Deref` impl for `MatrixVec` as it could cause hard-to-understand compilation errors.
### nalgebra-glm
* Add several alternative projection computations, e.g., `ortho_lh`, `ortho_lh_no`, `perspective_lh`, etc.
* Add features matching those of nalgebra, in particular: `serde-serialize`, `abmonation-serialize`, std` (enabled by default).

View File

@ -1,6 +1,5 @@
#[cfg(feature = "abomonation-serialize")]
use std::io::{Result as IOResult, Write};
use std::ops::Deref;
#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::vec::Vec;
@ -81,14 +80,11 @@ impl<N, R: Dim, C: Dim> VecStorage<N, R, C> {
self.data
}
}
impl<N, R: Dim, C: Dim> Deref for VecStorage<N, R, C> {
type Target = Vec<N>;
/// The number of elements on the underlying vector.
#[inline]
fn deref(&self) -> &Self::Target {
&self.data
pub fn len(&self) -> usize {
self.data.len()
}
}
@ -145,7 +141,7 @@ where DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>
#[inline]
fn as_slice(&self) -> &[N] {
&self[..]
&self.data
}
}
@ -189,7 +185,7 @@ where DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>
#[inline]
fn as_slice(&self) -> &[N] {
&self[..]
&self.data
}
}