Benign cargo Download

repeat.rs

SHA-2565f83f9c3efd1accbfdb26c24b9fbda6dbcccc350942f95468b029094d32f8fc5
Malecule∅

Evidence

imports std::iter lines 1–8
1use super::plumbing::*;
2use super::*;
3use std::iter;
4use std::usize;
5
6/// Iterator adaptor for [the `repeat()` function](fn.repeat.html).
7#[derive(Debug, Clone)]
8pub struct Repeat<T: Clone + Send …
English function-word token "that" lines 9–14
9:4… element: T,
10}
11
12/// Creates a parallel iterator that endlessly repeats `elt` (by
13/// cloning it). Note that this iterator has "infinite" length, so
14/// typically you would want to use `zip` or `take` or some …
Rust materializes an iterator with .collect() lines 23–26
23:2… // let x: Vec<(i32, i32)> = repeat(22).zip(0..3).collect();
24/// assert_eq!(x, vec![(22, 0), (22, 1), (22, 2)]);
25/// ```
26pub fn repeat<T: Clone + Send>(elt: T) -> Repeat<T …
English function-word token "with" lines 40–44
40:5… }
41
42 /// Iterate tuples repeating the element with items from another
43 /// iterator, similar to the general
44 /// [`zip()`](trait.IndexedPara …
English function-word token "and" lines 170–175
170:62… eat<T>>`, but
171/// we need `DoubleEndedIterator` and unconditional `ExactSizeIterator`.
172struct Iter<T: Clone> {
173 element: T,
174 count: usize,
175}

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.