<commit_before>use std::iter::RandomAccessIterator;

/**
(
<em>a</em><sub>0</sub>,
<em>a</em><sub>1</sub>,
...
)
&nbsp;&rarr;&nbsp;
(
<em>a</em><sub>0</sub>`.clone()`,
<em>a</em><sub>1</sub>`.clone()`,
...
)

*/
pub trait CloneEachIterator<'a, E>: Iterator<Item=&'a E> + Sized where E: Clone {
    /**
Creates an iterator which will clone each element of the input iterator.
    */
    fn clone_each(self) -> CloneEach<Self> {
        CloneEach {
            iter: self,
        }
    }
}

impl<'a, It, E> CloneEachIterator<'a, E> for It where It: Iterator<Item=&'a E>, E: Clone {}

#[derive(Clone, Debug)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct CloneEach<It> {
    iter: It,
}

impl<It> CloneEach<It> {
    /**
Unwraps the iterator, returning the underlying iterator.
    */
    pub fn unwrap(self) -> It {
        self.iter
    }
}
<commit_msg>Deprecated CloneEach since there's `cloned()` in the std lib now.<commit_after>use std::iter::RandomAccessIterator;

/**
(
<em>a</em><sub>0</sub>,
<em>a</em><sub>1</sub>,
...
)
&nbsp;&rarr;&nbsp;
(
<em>a</em><sub>0</sub>`.clone()`,
<em>a</em><sub>1</sub>`.clone()`,
...
)

*/
pub trait CloneEachIterator<'a, E>: Iterator<Item=&'a E> + Sized where E: Clone {
    /**
Creates an iterator which will clone each element of the input iterator.
    */
    #[deprecated = "use `it.cloned()` provided by the standard library"]
    fn clone_each(self) -> CloneEach<Self> {
        CloneEach {
            iter: self,
        }
    }
}

impl<'a, It, E> CloneEachIterator<'a, E> for It where It: Iterator<Item=&'a E>, E: Clone {}

#[derive(Clone, Debug)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct CloneEach<It> {
    iter: It,
}

impl<It> CloneEach<It> {
    /**
Unwraps the iterator, returning the underlying iterator.
    */
    pub fn unwrap(self) -> It {
        self.iter
    }
}

{'fraction_non_alphanumeric': 0.1891042430591933, 'fraction_numerical': 0.0041906757464641176, 'mean_word_length': 3.2538975501113585, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1422787', 'n_tokens_mistral': 709, 'n_tokens_neox': 718, 'n_words': 175}