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/interleave_shortest.rs | 85 ---------------------------- 1 file changed, 85 deletions(-) delete mode 100644 vendor/rayon/src/iter/interleave_shortest.rs (limited to 'vendor/rayon/src/iter/interleave_shortest.rs') diff --git a/vendor/rayon/src/iter/interleave_shortest.rs b/vendor/rayon/src/iter/interleave_shortest.rs deleted file mode 100644 index 7d81369..0000000 --- a/vendor/rayon/src/iter/interleave_shortest.rs +++ /dev/null @@ -1,85 +0,0 @@ -use super::plumbing::*; -use super::*; - -/// `InterleaveShortest` is an iterator that works similarly to -/// `Interleave`, but this version stops returning elements once one -/// of the iterators run out. -/// -/// This struct is created by the [`interleave_shortest()`] method on -/// [`IndexedParallelIterator`]. -/// -/// [`interleave_shortest()`]: trait.IndexedParallelIterator.html#method.interleave_shortest -/// [`IndexedParallelIterator`]: trait.IndexedParallelIterator.html -#[must_use = "iterator adaptors are lazy and do nothing unless consumed"] -#[derive(Debug, Clone)] -pub struct InterleaveShortest -where - I: IndexedParallelIterator, - J: IndexedParallelIterator, -{ - interleave: Interleave, Take>, -} - -impl InterleaveShortest -where - I: IndexedParallelIterator, - J: IndexedParallelIterator, -{ - /// Creates a new `InterleaveShortest` iterator - pub(super) fn new(i: I, j: J) -> Self { - InterleaveShortest { - interleave: if i.len() <= j.len() { - // take equal lengths from both iterators - let n = i.len(); - i.take(n).interleave(j.take(n)) - } else { - // take one extra item from the first iterator - let n = j.len(); - i.take(n + 1).interleave(j.take(n)) - }, - } - } -} - -impl ParallelIterator for InterleaveShortest -where - I: IndexedParallelIterator, - J: IndexedParallelIterator, -{ - type Item = I::Item; - - fn drive_unindexed(self, consumer: C) -> C::Result - where - C: Consumer, - { - bridge(self, consumer) - } - - fn opt_len(&self) -> Option { - Some(self.len()) - } -} - -impl IndexedParallelIterator for InterleaveShortest -where - I: IndexedParallelIterator, - J: IndexedParallelIterator, -{ - fn drive(self, consumer: C) -> C::Result - where - C: Consumer, - { - bridge(self, consumer) - } - - fn len(&self) -> usize { - self.interleave.len() - } - - fn with_producer(self, callback: CB) -> CB::Output - where - CB: ProducerCallback, - { - self.interleave.with_producer(callback) - } -} -- cgit v1.2.3