src/loc.rs

branch
dev
changeset 35
3b82a9d16307
parent 28
331345346e7b
child 43
239aa32f0e7d
equal deleted inserted replaced
34:3dbc04100b09 35:3b82a9d16307
133 fn from(other: F) -> Loc<F, 1> { 133 fn from(other: F) -> Loc<F, 1> {
134 Loc([other]) 134 Loc([other])
135 } 135 }
136 } 136 }
137 137
138 impl<F> Loc<F, 1> {
139 #[inline]
140 pub fn flatten1d(self) -> F {
141 let Loc([v]) = self;
142 v
143 }
144 }
145
138 impl<F, const N : usize> From<Loc<F, N>> for [F; N] { 146 impl<F, const N : usize> From<Loc<F, N>> for [F; N] {
139 #[inline] 147 #[inline]
140 fn from(other : Loc<F, N>) -> [F; N] { 148 fn from(other : Loc<F, N>) -> [F; N] {
141 other.0 149 other.0
142 } 150 }

mercurial