diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index ed9f7eff..08302f31 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -92,6 +92,20 @@ impl DVec { *self.at.unsafe_mut_ref(i) = val } + #[inline] + pub fn as_vec<'r>(&'r self) -> &'r [N] { + let data: &'r [N] = self.at; + + data + } + + #[inline] + pub fn as_mut_vec<'r>(&'r mut self) -> &'r mut [N] { + let data: &'r mut [N] = self.at; + + data + } + #[inline] pub fn to_vec(self) -> ~[N] { self.at