Skip to content

Commit 1fed7c2

Browse files
committed
DOC: Update examples and doc for Zip
1 parent 6e4c7ee commit 1fed7c2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/parallel/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
//! - [`ArrayBase::par_map_inplace()`]
2323
//! - [`ArrayBase::par_mapv_inplace()`]
2424
//! - [`Zip::par_apply()`] (all arities)
25+
//! - [`Zip::par_apply_collect()`] (all arities)
26+
//! - [`Zip::par_apply_assign_into()`] (all arities)
2527
//!
2628
//! Note that you can use the parallel iterator for [Zip] to access all other
2729
//! rayon parallel iterator methods.

src/zip/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,14 @@ impl<A, D: Dimension> NdProducer for RawArrayViewMut<A, D> {
573573
///
574574
/// // Check the result against the built in `.sum_axis()` along axis 1.
575575
/// assert_eq!(totals, a.sum_axis(Axis(1)));
576+
///
577+
///
578+
/// // Example 3: Recreate Example 2 using apply_collect to make a new array
579+
///
580+
/// let mut totals2 = Zip::from(a.genrows()).apply_collect(|row| row.sum());
581+
///
582+
/// // Check the result against the previous example.
583+
/// assert_eq!(totals, totals2);
576584
/// ```
577585
#[derive(Debug, Clone)]
578586
pub struct Zip<Parts, D> {

0 commit comments

Comments
 (0)