From 38349134023c124ac3f8c33fb25ae86870db3a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sun, 2 Nov 2014 22:47:11 +0100 Subject: [PATCH] Update to the last rust-nightly. Version of rustc: 0.13.0-nightly (3327ecca4 2014-11-01 22:41:48 +0000). --- src/structs/dvec.rs | 12 +++++------- src/structs/dvec_macros.rs | 4 ++-- src/structs/vec_macros.rs | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/structs/dvec.rs b/src/structs/dvec.rs index 6936d185..0560caff 100644 --- a/src/structs/dvec.rs +++ b/src/structs/dvec.rs @@ -57,6 +57,11 @@ impl DVec { pub fn from_fn(dim: uint, f: |uint| -> N) -> DVec { DVec { at: Vec::from_fn(dim, |i| f(i)) } } + + #[inline] + pub fn len(&self) -> uint { + self.at.len() + } } impl FromIterator for DVec { @@ -73,13 +78,6 @@ impl FromIterator for DVec { } -impl Collection for DVec { - #[inline] - fn len(&self) -> uint { - self.at.len() - } -} - dvec_impl!(DVec, DVecMulRhs, DVecDivRhs, DVecAddRhs, DVecSubRhs) /// Stack-allocated, dynamically sized vector with a maximum size of 1. diff --git a/src/structs/dvec_macros.rs b/src/structs/dvec_macros.rs index c54c98e0..3f80c43d 100644 --- a/src/structs/dvec_macros.rs +++ b/src/structs/dvec_macros.rs @@ -377,9 +377,9 @@ macro_rules! dvec_scalar_sub_impl ( macro_rules! small_dvec_impl ( ($dvec: ident, $dim: expr, $mul: ident, $div: ident, $add: ident, $sub: ident $(,$idx: expr)*) => ( - impl Collection for $dvec { + impl $dvec { #[inline] - fn len(&self) -> uint { + pub fn len(&self) -> uint { self.dim } } diff --git a/src/structs/vec_macros.rs b/src/structs/vec_macros.rs index 9568a69c..863a2ef8 100644 --- a/src/structs/vec_macros.rs +++ b/src/structs/vec_macros.rs @@ -282,9 +282,9 @@ macro_rules! dim_impl( macro_rules! container_impl( ($t: ident) => ( - impl Collection for $t { + impl $t { #[inline] - fn len(&self) -> uint { + pub fn len(&self) -> uint { Dim::dim(None::<$t>) } }