From 40c14ace390050d1d720c176d143462259d601ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Tue, 25 Nov 2014 11:00:26 +0100 Subject: [PATCH] Make `from_array`-like methods static. Fix #45. --- src/structs/mat_macros.rs | 6 +++--- src/structs/vec_macros.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/structs/mat_macros.rs b/src/structs/mat_macros.rs index bc236065..d539a6cc 100644 --- a/src/structs/mat_macros.rs +++ b/src/structs/mat_macros.rs @@ -36,11 +36,11 @@ macro_rules! as_array_impl( // FIXME: because of https://github.com/rust-lang/rust/issues/16418 we cannot do the // array-to-mat conversion by-value: // - // pub fn from_array(&self, array: [N, ..$dim]) -> $t + // pub fn from_array(array: [N, ..$dim]) -> $t /// View a column-major array of array as a vector. #[inline] - pub fn from_array_ref(&self, array: &[[N, ..$dim], ..$dim]) -> &$t { + pub fn from_array_ref(array: &[[N, ..$dim], ..$dim]) -> &$t { unsafe { mem::transmute(array) } @@ -48,7 +48,7 @@ macro_rules! as_array_impl( /// View a column-major array of array as a mutable vector. #[inline] - pub fn from_array_mut(&mut self, array: &mut [[N, ..$dim], ..$dim]) -> &mut $t { + pub fn from_array_mut(array: &mut [[N, ..$dim], ..$dim]) -> &mut $t { unsafe { mem::transmute(array) } diff --git a/src/structs/vec_macros.rs b/src/structs/vec_macros.rs index 7785933f..0933f33b 100644 --- a/src/structs/vec_macros.rs +++ b/src/structs/vec_macros.rs @@ -37,11 +37,11 @@ macro_rules! as_array_impl( // FIXME: because of https://github.com/rust-lang/rust/issues/16418 we cannot do the // array-to-vec conversion by-value: // - // pub fn from_array(&self, array: [N, ..$dim]) -> $t + // pub fn from_array(array: [N, ..$dim]) -> $t /// View an array as a vector. #[inline] - pub fn from_array_ref(&self, array: &[N, ..$dim]) -> &$t { + pub fn from_array_ref(array: &[N, ..$dim]) -> &$t { unsafe { mem::transmute(array) } @@ -49,7 +49,7 @@ macro_rules! as_array_impl( /// View an array as a vector. #[inline] - pub fn from_array_mut(&mut self, array: &mut [N, ..$dim]) -> &mut $t { + pub fn from_array_mut(array: &mut [N, ..$dim]) -> &mut $t { unsafe { mem::transmute(array) }