@@ -54,13 +54,13 @@ fn test_azip2_3() {
5454fn test_zip_collect ( ) {
5555 use approx:: assert_abs_diff_eq;
5656
57- // test Zip::apply_collect and that it preserves c/f layout.
57+ // test Zip::map_collect and that it preserves c/f layout.
5858
5959 let b = Array :: from_shape_fn ( ( 5 , 10 ) , |( i, j) | 1. / ( i + 2 * j + 1 ) as f32 ) ;
6060 let c = Array :: from_shape_fn ( ( 5 , 10 ) , |( i, j) | f32:: exp ( ( i + j) as f32 ) ) ;
6161
6262 {
63- let a = Zip :: from ( & b) . and ( & c) . apply_collect ( |x, y| x + y) ;
63+ let a = Zip :: from ( & b) . and ( & c) . map_collect ( |x, y| x + y) ;
6464
6565 assert_abs_diff_eq ! ( a, & b + & c, epsilon = 1e-6 ) ;
6666 assert_eq ! ( a. strides( ) , b. strides( ) ) ;
@@ -70,7 +70,7 @@ fn test_zip_collect() {
7070 let b = b. t ( ) ;
7171 let c = c. t ( ) ;
7272
73- let a = Zip :: from ( & b) . and ( & c) . apply_collect ( |x, y| x + y) ;
73+ let a = Zip :: from ( & b) . and ( & c) . map_collect ( |x, y| x + y) ;
7474
7575 assert_abs_diff_eq ! ( a, & b + & c, epsilon = 1e-6 ) ;
7676 assert_eq ! ( a. strides( ) , b. strides( ) ) ;
@@ -86,7 +86,7 @@ fn test_zip_assign_into() {
8686 let b = Array :: from_shape_fn ( ( 5 , 10 ) , |( i, j) | 1. / ( i + 2 * j + 1 ) as f32 ) ;
8787 let c = Array :: from_shape_fn ( ( 5 , 10 ) , |( i, j) | f32:: exp ( ( i + j) as f32 ) ) ;
8888
89- Zip :: from ( & b) . and ( & c) . apply_assign_into ( & mut a, |x, y| x + y) ;
89+ Zip :: from ( & b) . and ( & c) . map_assign_into ( & mut a, |x, y| x + y) ;
9090
9191 assert_abs_diff_eq ! ( a, & b + & c, epsilon = 1e-6 ) ;
9292}
@@ -101,7 +101,7 @@ fn test_zip_assign_into_cell() {
101101 let b = Array :: from_shape_fn ( ( 5 , 10 ) , |( i, j) | 1. / ( i + 2 * j + 1 ) as f32 ) ;
102102 let c = Array :: from_shape_fn ( ( 5 , 10 ) , |( i, j) | f32:: exp ( ( i + j) as f32 ) ) ;
103103
104- Zip :: from ( & b) . and ( & c) . apply_assign_into ( & a, |x, y| x + y) ;
104+ Zip :: from ( & b) . and ( & c) . map_assign_into ( & a, |x, y| x + y) ;
105105 let a2 = a. mapv ( |elt| elt. get ( ) ) ;
106106
107107 assert_abs_diff_eq ! ( a2, & b + & c, epsilon = 1e-6 ) ;
@@ -154,7 +154,7 @@ fn test_zip_collect_drop() {
154154 }
155155
156156 let _result = panic:: catch_unwind ( panic:: AssertUnwindSafe ( || {
157- Zip :: from ( & a) . and ( & b) . apply_collect ( |& elt, _| {
157+ Zip :: from ( & a) . and ( & b) . map_collect ( |& elt, _| {
158158 if elt. 0 > 3 && will_panic {
159159 panic ! ( ) ;
160160 }
@@ -308,7 +308,7 @@ fn test_indices_0() {
308308 let a1 = arr0 ( 3 ) ;
309309
310310 let mut count = 0 ;
311- Zip :: indexed ( & a1) . apply ( |i, elt| {
311+ Zip :: indexed ( & a1) . for_each ( |i, elt| {
312312 count += 1 ;
313313 assert_eq ! ( i, ( ) ) ;
314314 assert_eq ! ( * elt, 3 ) ;
0 commit comments