From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/rayon/src/iter/rev.rs | 123 ------------------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 vendor/rayon/src/iter/rev.rs (limited to 'vendor/rayon/src/iter/rev.rs') diff --git a/vendor/rayon/src/iter/rev.rs b/vendor/rayon/src/iter/rev.rs deleted file mode 100644 index a4c3b7c..0000000 --- a/vendor/rayon/src/iter/rev.rs +++ /dev/null @@ -1,123 +0,0 @@ -use super::plumbing::*; -use super::*; -use std::iter; - -/// `Rev` is an iterator that produces elements in reverse order. This struct -/// is created by the [`rev()`] method on [`IndexedParallelIterator`] -/// -/// [`rev()`]: trait.IndexedParallelIterator.html#method.rev -/// [`IndexedParallelIterator`]: trait.IndexedParallelIterator.html -#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] -#[derive(Debug, Clone)] -pub struct Rev { - base: I, -} - -impl Rev -where - I: IndexedParallelIterator, -{ - /// Creates a new `Rev` iterator. - pub(super) fn new(base: I) -> Self { - Rev { base } - } -} - -impl ParallelIterator for Rev -where - I: IndexedParallelIterator, -{ - type Item = I::Item; - - fn drive_unindexed(self, consumer: C) -> C::Result - where - C: UnindexedConsumer, - { - bridge(self, consumer) - } - - fn opt_len(&self) -> Option { - Some(self.len()) - } -} - -impl IndexedParallelIterator for Rev -where - I: IndexedParallelIterator, -{ - fn drive>(self, consumer: C) -> C::Result { - bridge(self, consumer) - } - - fn len(&self) -> usize { - self.base.len() - } - - fn with_producer(self, callback: CB) -> CB::Output - where - CB: ProducerCallback, - { - let len = self.base.len(); - return self.base.with_producer(Callback { callback, len }); - - struct Callback { - callback: CB, - len: usize, - } - - impl ProducerCallback for Callback - where - CB: ProducerCallback, - { - type Output = CB::Output; - fn callback

(self, base: P) -> CB::Output - where - P: Producer, - { - let producer = RevProducer { - base, - len: self.len, - }; - self.callback.callback(producer) - } - } - } -} - -struct RevProducer

{ - base: P, - len: usize, -} - -impl

Producer for RevProducer

-where - P: Producer, -{ - type Item = P::Item; - type IntoIter = iter::Rev; - - fn into_iter(self) -> Self::IntoIter { - self.base.into_iter().rev() - } - - fn min_len(&self) -> usize { - self.base.min_len() - } - fn max_len(&self) -> usize { - self.base.max_len() - } - - fn split_at(self, index: usize) -> (Self, Self) { - let (left, right) = self.base.split_at(self.len - index); - ( - RevProducer { - base: right, - len: index, - }, - RevProducer { - base: left, - len: self.len - index, - }, - ) - } -} -- cgit v1.2.3