From 396d394ab9da07d40171d7da6b1a28fc7024f3d3 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Mon, 16 Dec 2013 12:04:02 +0100 Subject: [PATCH] Use new std::vec functions --- src/structs/dmat.rs | 4 ++-- src/structs/dvec.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/structs/dmat.rs b/src/structs/dmat.rs index a10d8a00..586a3886 100644 --- a/src/structs/dmat.rs +++ b/src/structs/dmat.rs @@ -38,7 +38,7 @@ impl DMat { #[inline] pub unsafe fn new_uninitialized(nrows: uint, ncols: uint) -> DMat { let mut vec = vec::with_capacity(nrows * ncols); - vec::raw::set_len(&mut vec, nrows * ncols); + vec.set_len(nrows * ncols); DMat { nrows: nrows, @@ -244,7 +244,7 @@ impl DMat { /// Just like `at` without bounds checking. #[inline] pub unsafe fn at_fast(&self, row: uint, col: uint) -> N { - vec::raw::get(self.mij, self.offset(row, col)) + (*self.mij.unsafe_ref(self.offset(row, col))).clone() } } diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index e82fa3a6..935980e3 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -52,7 +52,7 @@ impl DVec { impl DVec { /// Indexing without bounds checking. pub unsafe fn at_fast(&self, i: uint) -> N { - vec::raw::get(self.at, i) + (*self.at.unsafe_ref(i)).clone() } } @@ -80,7 +80,7 @@ impl DVec { #[inline] pub unsafe fn new_uninitialized(dim: uint) -> DVec { let mut vec = vec::with_capacity(dim); - vec::raw::set_len(&mut vec, dim); + vec.set_len(dim); DVec { at: vec