Skip to content

Commit 7364d2b

Browse files
committed
update doc
1 parent c1a10b8 commit 7364d2b

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

Diff for: corelib/src/iter/traits/iterator.cairo

+1-38
Original file line numberDiff line numberDiff line change
@@ -113,53 +113,16 @@ pub trait Iterator<T> {
113113
/// Basic usage:
114114
///
115115
/// ```
116-
/// let a1 = array![1, 2, 3];
117-
/// let a2 = array![4, 5, 6];
118-
///
119-
/// let mut iter = a1.into_iter().zip(a2.into_iter());
120-
///
121-
/// assert_eq!(iter.next(), Option::Some((1, 4)));
122-
/// assert_eq!(iter.next(), Option::Some((2, 5)));
123-
/// assert_eq!(iter.next(), Option::Some((3, 6)));
124-
/// assert_eq!(iter.next(), Option::None);
125-
/// ```
126-
///
127-
/// Since the argument to `zip()` uses [`IntoIterator`], we can pass
128-
/// anything that can be converted into an [`Iterator`], not just an
129-
/// [`Iterator`] itself. For example:
130-
///
131-
/// ```
132-
/// let a1 = array![1, 2, 3];
133-
/// let a2 = array![4, 5, 6];
134-
///
135-
/// let mut iter = a1.into_iter().zip(a2);
136-
///
137-
/// assert_eq!(iter.next(), Option::Some((1, 4)));
138-
/// assert_eq!(iter.next(), Option::Some((2, 5)));
139-
/// assert_eq!(iter.next(), Option::Some((3, 6)));
140-
/// assert_eq!(iter.next(), Option::None);
141-
/// ```
142-
///
143-
/// If both iterators have roughly equivalent syntax, it may be more readable to use [`zip`]:
144-
///
145-
/// ```
146-
/// use core::iter::zip;
147-
///
148-
/// let a = array![1, 2, 3];
149-
/// let b = array![2, 3, 4];
150-
///
151-
/// let mut zipped = zip(a, b);
116+
/// let mut iter = array![1, 2, 3].into_iter().zip(array![4, 5, 6].into_iter());
152117
///
153118
/// assert_eq!(iter.next(), Option::Some((1, 4)));
154119
/// assert_eq!(iter.next(), Option::Some((2, 5)));
155120
/// assert_eq!(iter.next(), Option::Some((3, 6)));
156121
/// assert_eq!(iter.next(), Option::None);
157-
/// );
158122
/// ```
159123
///
160124
/// [`enumerate`]: Iterator::enumerate
161125
/// [`next`]: Iterator::next
162-
/// [`zip`]: core::iter::zip
163126
#[inline]
164127
fn zip<U, +Iterator<U> //, +IntoIterator<U>
165128
>(

0 commit comments

Comments
 (0)