@@ -1739,8 +1739,8 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
1739
1739
/// [1., 2.]])
1740
1740
/// );
1741
1741
/// ```
1742
- pub fn mapv < B , F > ( & self , f : F ) -> Array < B , D >
1743
- where F : Fn ( A ) -> B ,
1742
+ pub fn mapv < B , F > ( & self , mut f : F ) -> Array < B , D >
1743
+ where F : FnMut ( A ) -> B ,
1744
1744
A : Clone ,
1745
1745
{
1746
1746
self . map ( move |x| f ( x. clone ( ) ) )
@@ -1752,7 +1752,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
1752
1752
/// Elements are visited in arbitrary order.
1753
1753
pub fn mapv_into < F > ( mut self , f : F ) -> Self
1754
1754
where S : DataMut ,
1755
- F : Fn ( A ) -> A ,
1755
+ F : FnMut ( A ) -> A ,
1756
1756
A : Clone ,
1757
1757
{
1758
1758
self . mapv_inplace ( f) ;
@@ -1764,7 +1764,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
1764
1764
/// Elements are visited in arbitrary order.
1765
1765
pub fn map_inplace < F > ( & mut self , f : F )
1766
1766
where S : DataMut ,
1767
- F : Fn ( & mut A ) ,
1767
+ F : FnMut ( & mut A ) ,
1768
1768
{
1769
1769
self . unordered_foreach_mut ( f) ;
1770
1770
}
@@ -1785,9 +1785,9 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
1785
1785
/// [0.36788, 7.38906]]), 1e-5)
1786
1786
/// );
1787
1787
/// ```
1788
- pub fn mapv_inplace < F > ( & mut self , f : F )
1788
+ pub fn mapv_inplace < F > ( & mut self , mut f : F )
1789
1789
where S : DataMut ,
1790
- F : Fn ( A ) -> A ,
1790
+ F : FnMut ( A ) -> A ,
1791
1791
A : Clone ,
1792
1792
{
1793
1793
self . unordered_foreach_mut ( move |x| * x = f ( x. clone ( ) ) ) ;
0 commit comments